There are a lot of factors from GPA, rank, course rigor, race, geography, hooks, poverty, wealth, standardized tests, EC’s, rec letters, essays, awards etc etc etc. You can do it all right and still miss it. Fortunately, there are lots of good colleges out there which aren’t lottery based.