But how would such a state of affairs have come about? That is the hard part because there is no obvious parallel from the medieval world from where fantasy authors crib their history. Except that there is in semi-forgotten nations like Venice, the Commonwealth of Poland-Lithuania, Switzerland, and various merchant and aristocratic republics. In one sense they were not anything like the early United States because part of what caused the US to come into being was the work of provocateurs that wanted to overthrow the class system. So though republics these places were not terribly egalitarian relative to either present day societies or even early America.
What if, just what if, there were a number of aristocratic republics that were ruled by a king who had conquered them some decades before. Like if the French had been successful in conquering a large portion of Italy. And then there was a revolution that was one part idealism and one part nationalism. It might be possible to conceive of a way in which the fractious merchant republics might come together into a federation not totally unlike the early United States. There would still be titles and such, but they would mean landowner, voter, or merchant rather than being a title of blood.
Alternatively researching the golden years or troubled times of the Swiss Confederation might prove a rich new vein for fantasy stories that are not about the inevitable good heir vs. the bad heirs of the kingdom or the noble and good family of aristocratic linage.
(Note: I am going to refine this and eventually post a more detailed version in storyguypress.)