This is the correct answer. When you drop off the bottom 30 percent of the population via the AFQT requirement (the part of the ASVAB that correlates well with IQ) you are getting rid of 100,000,000 nitwits. Further to those, you also get rid of the criminals, and psychos, and junkies. This makes the military a kind of modest elite. Their children reflect that and do reasonably well in school.
Are people with 125+ IQs enlisting? Not for the most part, but almost none of the 75 IQ people are enlisting, and they cause a wild disproportion of the problems in society.
The minimum ASVAB to enlist is 31, and there are waiver programs for that. This is not a good showing. I feel like people don't appreciate how little lower-enlisted people are paid, what terrible financial literacy abounds in the ranks, and how many kids live on base but are still very firmly living in poverty.
There are a lot of advantages to living on base, but this thread is pretending that the military has its shit together in ways that it absolutely does not. "All the kids will be well-fed and socialized" is bizarrely out of touch, specifically. There are functioning gangs on some larger military installations. Troops PCS every few years, making it difficult for kids to establish social groups. Most bases have a unit of MPs basically acting as child services.
I'd think a better place to look for filters would be entire schools -- BRAC has caused the closure of many schools, but I don't know how they select which schools to target for closure. I know of at least two larger bases which have no schools (students are bused to local civilian schools) but I know others who have kept their schools despite a lower overall population of families.