I would echo the forward-looking advice by voxanonyma and just add that it's a tough numbers game. A prof at a top program (Harvard/Yale/Princeton) told me that this year they got 150 applications for 4 spots. And I doubt they will need to go deep into their waitlist, if at all. Assume that the majority of those applications satisfy the basic requirements in languages and other preparation; assume that the majority of those have glowing recommendations, great stats, etc. I truly think it comes down to program fit and some intangibles, as well as the brutal fact that there are simply not enough spots for the number of qualified applicants. I know all the generic rejection letters say this (and I've gotten my share of them), and it can be painful to hear and to accept, but it is sadly the truth. In any given year, the top programs could fill their cohorts several times over with qualified applicants.
The good news is that there absolutely are strategies to improve one's application and to apply to programs with a good fit, as noted by other posters.
I'm mostly a lurker but wanted to post to hopefully help with the coping and looking to the future!