One of the main goals of worldbuilding is to create a believable backdrop for telling a story. But after figuring out geography, magic, and fantastical mythological creatures, there needs to be some sort of societal structure in place. And the societal structure that plays perhaps the largest role in determining the feel of a region is the government that rules it. Who you choose to rule your characters (and how) can shape a story.
Here are some examples or common government types.
The old fantasy standby. It has a well documented history in real life to draw on, a simplistic, figurehead focused that can be delved into with great detail should the need arise. Most readers will have a feel for how lords, princes, and princesses fit in, and where the peasants rank in the grand scheme (which is to say: not at all, right up to the point they gather in vast numbers and revolt). Monarchies can be portrayed as either benevolent or oppressive, usually but not exclusively in line with the disposition of the monarch. There are just as many stories about nobles fighting for their people/king as there are peasant heroes trying to fight the powers that be.
Science fiction can use this framework as well, but most often it is to draw a parallel to a real-world government. This is one of the subtle ways that sci-fi can satirize by taking a concept to its logical (or at least one plausible) conclusion.
Flipping to the other end of the spectrum, a perfectly conceived democracy gives all the power to the people to determine their own rulers. Most systems will make tradeoffs to allow for a more efficient selection system (democratic republics), but generally some form of democracy is viewed as necessary to maintaining a free, socially just country (as determined mainly by people who already live in a democracy, of course).
Fantasy can implement this, most often in a most republican setting akin to ancient Rome. Most of the time, the elaborate government infrastructure required to keep a democracy running smoothly (as smoothly as any government can run, at least) are burdensome without at least some modern inventions. With advances in communication technology available at the tips of an author’s fingers, science fiction can automate and streamline voting and collaboration to make governments besides democracy a matter of choice, rather than a necessity arising from logistical concerns.
Storytelling-wise, it can be fun to show the flip side of things, and explore the consequences of a wayward democracy that no longer serves the people it purports to represent.
Theocracy really just means rule by religion. It practice it can take on aspects of many other forms of government. There can be a hereditary “pope” or similar religious figure who rules in dynastic fashion. A theocrat can be elected, though the electors will be restricted to religious officials of at least a certain rank. Less commonly, a violent religion may allow someone to rule through might of arms.
One method of choosing a ruler that is unique to theocracy is a sufficiently interventionist deity acting directly to appoint the leader of his worshipers.
While it provides little to nothing in the way of structure, anarchy offers plenty of opportunity for chaos to drive a story. Various warlords, politicians, and/or deposed nobles can be vying for power, or the region might just descend into general chaos. Usually this form of governmentlessness is temporary. People tend to want order and direction, for safety if nothing else.
“The bureaucracy is expanding to meet the needs of the expanding bureaucracy.”
This is one of my favorite quotes included in Civilization IV, and they didn’t know its origin (probably lost in a manila file folder somewhere). At some point, a government can become so bloated with the instruments of rulership that the bureaucracy actually becomes the de facto ruler. Codified rules and policies, carried out by dedicated (if unmotivated) functionaries, can carry as much weight as the edict of a king.
There is a whole genre of dystopian science fiction that often explores not the destruction of civilization, but of the triumph of the bureaucratic machine over the individual. This Kafkaesque fiction serves as a warning against putting too much faith in rules and regulations.
This is a hybrid form of monarchy and democracy where a small group, chosen for their wisdom (or the perception of their wisdom), appoints a ruler. This ruler is often beholden to the council for approval of controversial decisions. It can also be a form of republican government where a small group of appointees each represent the interests of a much larger constituency. The former is common in tribal communities, whereas the latter could represent overarching organizations of governments such as the UN (real world) or the United Federation of Planets (Star Trek).
This is another hybrid form of government, split between democracy and bureaucracy. In an attempt to do what’s best for the people, the people (and their uninformed decisions) are removed from the equation. Leadership positions are filled by opaque processes that often involve rising through the ranks of a political party system or advancing from overseeing ever-larger domains within the greater government. In theory it is a Utopian system; in practice, it usually leads to an oligarchy controlling the government’s wealth and is prone to corruption.