Given current UN laws, it would make sense for their to be a UESPA first and no official military organization that is operating outside the national militaries until United Earth gains enough support to get its own military officially. This is done years later. Starfleet could emerge as a sub-division of UESPA that handles anti-piracy duties and the like that are far outside the national governments reaches. Like a pseudo Peacekeeper group of the UN, but with the name Starfleet. This one operates under UESPA as that organization has all the rescources to deal with long distance communications and already has the facilities on various human planets. Basically it is cheaper to use UESPA than to start fresh.
Over time, Starfleet becomes more independent, but the national governments do not what it to take over, so the keep in under the UESPA heading as a political move. By the time of the NX-01, Starfleet is more or less the main force, but still under the UESPA title officially. This might have changed had Enterprise and Captain Archer not been actively trying to form an inter-species Alliance that eventually became the Federation.
After the formation of the Federation, Starfleet is moved out from UESPA to became Earth's part of the Federation military structure using their remaining starships and other vessels from the Romulan War. UESPA continues on until the end of the 23rd century when its duties are rolled up into the enlarging Federation Starfleet. USS Excelsior being one of the last starships to operate under UESPA. UESPA likely goes away as more and more members join the Federation and make it more reduntant than it already was. Earth's contribution to the Federation not needing to be as large as it once was.
Over time, Starfleet becomes more independent, but the national governments do not what it to take over, so the keep in under the UESPA heading as a political move. By the time of the NX-01, Starfleet is more or less the main force, but still under the UESPA title officially. This might have changed had Enterprise and Captain Archer not been actively trying to form an inter-species Alliance that eventually became the Federation.
After the formation of the Federation, Starfleet is moved out from UESPA to became Earth's part of the Federation military structure using their remaining starships and other vessels from the Romulan War. UESPA continues on until the end of the 23rd century when its duties are rolled up into the enlarging Federation Starfleet. USS Excelsior being one of the last starships to operate under UESPA. UESPA likely goes away as more and more members join the Federation and make it more reduntant than it already was. Earth's contribution to the Federation not needing to be as large as it once was.