Quick worldbuilding hack, if you want to make a coherent political system for your fantasy world:
Basically, between the fall of Rome and early modern times, in Europe* most political organization wasn't actually kingdoms ruled by One True King like it's usual in fantasy, but something like this:
Feudalism: here, the center of power was not the nation (there was little concept of such thing) or the state, and not even the King, but the landowners (from kings to dukes to counts...) and their network of vassalages to each other. There were no "countries" but rather hereditary titles, and the people who held them. There was little of a true state besides what individual rulers did; they didn't even have formal armies as such, but rather the vassals who provided them, they and could have multiple allegiances. Examples are of course the Holy Roman Empire (neither holy, etc. etc.) France (note that the 100 Years War was a dispute about titles rather than France vs. England), Spain (actually a bunch of kingdoms and crowns rather than a country), etc...
"Empires": A state where a central goverment exerts power over other territories and peoples. These are rather familiar to us, because a formal state exists here, and the ruler is more powerful and often does have a standing arming and administration instead of relying on vassals. Here, there is a bureacracy and a claim to rule a territory, and while they might have vassals and prominent artistocratic families (everyone did) their administration was state-based, not allegiance based. The Roman Empire is the most imperial empire, as well as its cringefail successor the Byzantine Empire, but note that the great Islamic empires also had this kind of administration, with governors appointed and confirmed by the imperial court.
City-States: Basically a powerful city (though they were often the size of small towns, still, very rich) ruled by a local aristocracy, sometimes hereditary, sometimes elected from a few families or guilds, or a mix of both, and in some cases ruled by religious authorities. These could be independent or organized in alliances, but were often vassals of more powerful goverments such as above. Cities are in many way the building brick of larger states; of note, in the Ancient Mediterranean before Rome conquered it all, leagues of city-states were the main powers. Medieval and Early Modern independent city states were the Italian city states of course, and a famous league was the Hansa (many of its members themselves vassals of other powers)
Tribes and Clans: Every culture is different with this, but basically here the centre of power is the relationships between families and kinship. If this sounds familiar to Feudalism, you've been paying attention; Feudalism is what happened when the Roman empire and administration fell, and it was replaced by landowners and their ties of vassalage and allegiances.
Now, besides the history lesson, why is this important? Because there are reasons why rulers had their power, and you should know that.
A king never ruled alone. He was only the head of nobles tied by vassallage (feudalism), or the head of a inherited state bureaucracy and army ("empire"). If you killed the king, another one would rise from the prominent families. Often by bloody civil wars or conquest yes, but the system overall would stay. A king did not reign by its own power or virtue, but because the system itself supported him, and of course, he maintained the system.
A new king who wants to replace the bad old king (a common fantasy storyline) needs to also deal with the allegiances of all its vassals (who would probably rather kill him and take the throne themselves) or build a bureaucracy and an army, supremely expensive endeavors in those times, which took decades if not centuries to build. In fact, the Byzantines and the Arabs inherited most of their state aparatus, in one way or the other, from the Romans.
This is also why these systems lasted so long, too. The appearance of modern republics and other systems of goverment needed the coordination of people and revolutions that did not just kill the king, but also replace it with something else, and for that you need literacy, economic changes, an empowered populace... But that's for another time.
I hope this is fucking helpful because I don't want to spell allegiance ever again.
*I would love to do more about goverments outside Europe, especially Precolombine American ones like the redistrubitionist state-based economy of the Incas, or the Mesoamerican city-states. But that's for another time.