Getting into a good grad school

I was wondering what you have to do as an undergrad to get into a school like MIT to study physics or engineering as a graduate. How are things like GPA, GRE score, extracurricular activities, research,\ internships, and your undergrad university weighted? What might a typical accepted student's background look like? Thanks.

Well it depends on the field, but this is what I have heard, in order of importance:

1) Recommendations - who they are, and what they say. This is why it helps to go to a good school as an undergrad, if you can get someone well known in the field to write you a good recommendation letter, its a huge bonus