Most of them go through a grueling application and testing process before they even get to the academy.
Do they? Apart from Wes Crusher, who competed in the underage boy wonder category, "demanding tests" don't get much mention. Nog faced some, but nothing out of the ordinary; a couple of years before the successful entry, the boy couldn't even read! Picard or Riker never mentioned demanding entry exams. In at least one reality, Kirk was dragged into Starfleet literally kicking and screaming, his "entry exam" being a bar fight (which he lost)!
There might be a collection of overachievers aboard the Federation Flagship, but Kirk's, Sisko's or Janeway's crew never seemed to consist of just the best and the brightest.