Star Trek is the definitive aspirational science fiction series. However, the allegorical institution representing universal cooperation -- the United Federation of Planets -- was a late addition, replacing the "United Earth" space force envisioned by creator Gene Roddenberry. One of the most important elements in the franchise's lore came from the man known as "Star Trek's other Gene."
Source:https://www.cbr.com/star-trek-federation-united-earth-evolution-explained/