In reference to the United States, sixteen was for a long time recognized as the standard age for being eligible to get a driver's license (I'm aware that there are states where the age was younger, but most commonly it was sixteen). The legal voting age in the U.S. is 18 (down from a previous age of 21), which is also the age at which a minor becomes legally recognized as an adult. It's legal to smoke at 18 and to enlist in the armed services; legal to drink and gamble at 21.
How were these various ages arrived at? Meaning, how did we arrive at the conclusion that 18 was the appropriate time to legally classify someone as an independent adult, capable of making their own decisions without someone acting on their behalf? Prior to that, why did we arrive at 21 as the magic number? Why not 20, or 25?
How is it that we have discrepancies? If the rationale behind setting 18 as the age at which someone can legally choose to smoke, to vote, to serve in the military is that we've already declared them an adult, then why is the legal age for drinking or gambling not set until 21?
Did the legal standards grow out of general cultural trends, or what?
Follow-on question: this post asks specifically about the US, but 18 seems to be a milestone age in many (most?) other countries as well. How did this come to be?