For all appearances, they do have the very same origin: the United States Navy, which for some reason becomes the United Earth Starfleet and then the UFP Starfleet, merely adding on various details along the centuries...
But there are known
differences that are very relevant to the matter at hand. The length of academic studies required for attaining officer commission is flexible in Starfleet, including at least three-, four- and five-year study structures. The (human) entry age to the Academy varies as well, at least between fifteen for Wes Crusher and twenty-two for nuKirk, although there are also many gray-haired Ensigns in evidence, and some combination of the above two ambiguities allows nuChekov to have attained Ensign commission by the age of seventeen.
Whatever we don't
know about Starfleet is secondary to these things. And especially to the explicit fact that Starfleet gives captaincies ("Conspiracy") and promotions to Captain rank (STXI) to 25-year-olds.