A major factor is that the military are training ab initios who have gone through a tough selection process. Civilian schools have to train anyone who comes through the door and can afford flying lessons.
A similar change has happened in the airline world; at one time airlines trained their pilots from scratch, so were very selective in who they took on. These days studes pay for their own training, so if a candidate is a 'no hoper' and doesn't make the grade, the only loser is the candidate.