While this is a common belief (and many people, before I went to MIT, were very effusive in telling me how much it would benefit me), my experience is that it is a myth (or at least it was at MIT when I was there). Of course there were high achieving people at MIT when I was there, but there were also plenty who were not; overall I don't think the distribution of motivation was much different from high school. (Motivation is not the same thing as grades: most of my fellow students at MIT got straight A's in high school for the same reason I did, that for us, high school was simply not that challenging academically, so we could be lazy and still make the grades.) As for what I learned from my fellow students, I can't say I learned nothing (since, for example, learning what pot smells like counts as learning something), but I don't think I learned anything significant academically that I wouldn't have learned from my peers at a less selective school.
There are plenty of top quality professors at such schools.
Not every professor can make things work for their family at Stanford or MIT. Maybe their partner has a modest income so to afford a house so they go work at Penn State or whatever.
https://ocw.mit.edu/courses/mathematics/18-100b-analysis-i-f...