The age that school stops being mandatory is not 18 everywhere. 

Free public schooling ends at 18, but the reason for that is because of the pre-existing notion of 18 being an adult, not for any particular reason of 18 actually being an adult. It's another arbitrary line that was drawn.