I worked hard. I pursued what I loved. I visited teachers as often as I could to get the best recommendations I could. And I researched the institutional history of each college I applied to so I could write a letter tailor made for them and what they were looking for.
I had a low gpa, bad test scores, and weak extracurriculars, btw. So it’s by no means impossible for students who aren’t at the tippy top to get into an ivy. It just takes some extra work.