Muscle strength is far from the most valuable military skill in most roles these days, and arguably hasn't really been since the 19th century when most combat became firearms oriented. Yes, it still plays a role, and for some jobs, it is among the most important, but they're a minority.
Ability and willingness to follow orders is probably paramount, along with reflexes, and some common sense and logical abilities. And then of course, proficiency in your role.
18 year olds are typically right out of school, so learning new roles comes easy. They've also typically come right out of a situation in life where the expectation of following commands is pretty fresh, even if they perhaps weren't the best at following through (the military has ways to fix that).
And perhaps most importantly, for folks that are staying in for the career, or at least longer than the minimum level of service, joining at 18 means that you've had time to get training and experience so when you DO hit that "prime muscle strength" time of life, you're a well honed killing machine. Waiting til you've hit that point means you'll be going in cold, and get suboptimal results.