Back in the 1970s-80s, I signed up for an army Short Service Commission (SSC) in the UK, a country that doesn't have compulsory military service. Many of my school pals who were British joined the army, navy or air force because it was the done thing in my school in those days.
In those days, the army SSC lasted roughly 3 years, with option to leave after 2.5 years. (The navy and air force had different SSC specifications.) Those 3 years were short enough to live through, and at the end of it, it represented something 'real' to put into the CV for a job search later on. The pay was pretty good too for an 18 year old at the time (roughly £7,000 p.a. in my case). So, it boils down to money in my case, which sounds quite mercenary in tone looking back now.
For my foreign schoolmates, many have had to cut short their schooling and returned to their home countries for compulsory military service, or joined up their own armed forces (if professional contracts had been available).