One of the more curious aspects of the Star Trek universe is the fact that elections are never mentioned. The United Federation of Planets is held up as the great defender of individual freedom and “human” rights, and throughout the series those rights are a constant source of debate for both Federation members but also the many worlds applying to join the alliance. There is no question that individual freedom is a keystone of Federation citizenship. But we have no idea how those citizens govern themselves, or indeed if they even do, or just exist in a form of benign communist state.
Viewers know that there is a president of the Federation, who is answerable to a Federation Council, which is a legislature made up of representatives of the various members planets of the Federation who have their own governments, but that is pretty much all the knowledge we actually have about government within the UFP.
Having said that, it is possible to speculate what form of government exists. In “Picard” Admiral Clancy points out that member governments of the Federation overruled the mass evacuation of Romulan refugees, and in Star Trek: Insurrection rogue Admiral Dougherty (Is every baddy Starfleet admiral of Irish extraction?) warned that if the Federation public heard of the conspiracy he was involved in there would be problems.
It’s very possible that the United Federation of Planets is a European Union style indirect democracy, where citizens elect (or at least consent to) their member planet government, which sends representatives to the Federation Council, and the Council elects a president. It would also explain why the Federation Presidents tend to be weak non-descript characters (as most European Commission Presidents are, at least initially).
Whilst one is given the impression watching the various Star Trek series that the Federation Council is the highest legislative authority within the alliance, and has power over Starfleet, Starfleet does seem to have considerable on the ground autonomy. Having said that, it’s worth recognising that we only really see the chain of command between admirals and ship captains, and any time the Federation President does appear on screen (especially in Star Trek: Discovery, but not only) Starfleet admirals are clearly subordinate to the civilian leadership.
Finally, one other that is almost never mentioned in Star Trek is, of course, the fact that every member planet has its own government and its own system of government, and that those governments are not necessarily democracies, although having said that the Federation has rejected membership bids from planets with governments that discriminate against minorities or do not rule with the broad consent of their people. It’s also clear that every Federation citizen has access to a common set of rights not dissimilar to European Union citizenship.
The most logical conclusion is that the Federation is, in effect, an indirect democracy with very high levels of freedom. The governments of the planets that make up the Federation are, at a minimum, in office with broad consent, by whatever means their culture dictates, and those governments send representatives to the Federation Council and the Federation Council in turn elects a President of the Federation. And like the European Union, the Federation has freedom of movement (indeed, its possible the Federation has open borders) which allows citizens of both Federation and non-Federation worlds to live on a planet with a culture of their own choosing. Or indeed, even start their own colony.