This is my original answer to the same question on Quora.
Actually, the numbers provided by Martin Strohmeier are a little bit overestimated as only the technical universities in Aachen, Dresden, Munich and Berlin have over 30k students. The ones in Braunschweig and Stuttgart are on par with those in Karlsruhe and Darmstadt with about 20k students. Of this list, only the TUs in Ilmenau and Kaiserslautern are a little smaller with about 10k students.
However, size does not correlate with reputation in the obvious way you described. Every German technical university has its strong areas in research and/or teaching as well as its weak ones. As you mentioned, for an undergraduate degree this would make almost no difference apart from obvious reasons like location, financial concerns, etc. Nevertheless, my subjective opinion is that some of the aforementioned schools normally do a better job at that than others.
For a postgraduate degree, that is PhD or Dr.-Ing. and a MSc to some extent, one would be bette off checking for research groups being involved in the topics of interests – the more, the merrier. Another concern may be the work with and/or direct participation in some sort of a research center consortium as many groups are not only university-based. Examples include but are not limited to KIT, JARA and the Garching scientific campus. Depending on the professional and/or personal interests of a candidate, this may be of major importance.
Nevertheless, my highly subjective opinion is that some of the aforementioned schools as well as some others normally do a better job at that than others. My recommendation for a general undergraduate course in Mechanical Engineering (e.g. BSc and some MSc) would go to any university of the TU9 German Institutes of Technology consortium as they defend a strong position on common interests against German industry and society.
My personal favourites with research of highest quality are KIT, TU München, RWTH Aachen, and TU Berlin (in no particular order). I am more than satisfied with the quality of teaching in Karlsruhe and Munich. Additionally, there are numerous conferences and workshops with people from the industry and different scientific institutions. My limited contact with major scientists from the other three universities I like most has been highly positive as well. It is because of the lack or small quantity of such interactions, that I can’t give any preference on the other universities apart from these four regarding study and/or research in the field of Mechanical Engineering and surrounding mostly technical disciplines like Electrical Engineering, Computer Science, Mathematics and Natural Sciences.
: Originally, I mentioned the TU in Darmstadt instead of that in Berlin, but as it turns out, I have had significantly more contact with researchers from the German capital than in the other city. I also added that I am more than satisfied with the quality of teaching in Munich as I changed schools since the original post.