Ceteribus paribus, the military provides stable job, income, and a generous scholarship.
The scholarship is roughly $70-$100k depending on school and a monthly housing stipend. For SF area, that stipend is $4.2k/month
My point being, there's tons of military jobs that don't involve violence. For each job that does require violence, dozens more auxiliary positions are required to support that job.
They have been fortunate. Obviously, in some conflicts, some people in all of those roles end up in postings where they are in hazardous areas. (Also: IIRC drone pilots stationed far from conflict still experience combat-induced PTSD.)
The other feature of the armed services is that in general, once you enlist you don't always get to choose your posting. It's great that some people get to choose plum jobs away from war zones, but (most?) others don't (and this can change for anyone in the military, at any time). A defining feature of a military is orders, and following them.
Military careers can be rewarding for some people. But just as it's wrong to say college is for everyone, it's not correct to suggest that one can embark on a military career without adding additional personal safety risk.
This worked out fine for me, no shooting involved: https://en.wikipedia.org/wiki/35T
Getting shot at for an education doesn't seem that great. Better off just moving to a better country.