I don't consider myself to be very knowledgeable in history and wouldn't argue with someone who was, but are you telling me there have not been wealthy merchants throughout history in most eras that have enjoyed luxury, comfort and influence over peasants and kings?
No, because that would CLEARLY be false!
What I'm saying is that kings and other royalty had power that "merchants" and other wealthy individuals did not have: ultimate political power, backed by an army. The power to tax to ruin, power of life & death.
While merchants could indeed have powerful private armies, in most cases, they were not as powerful as what the ruling class could bring to bear. And an army isn't going to help you if/when you get summoned to court...and the ruler decides to have you executed on the spot.
In D&D however, you have Magic. The Baron would be hard pressed to keep someone who can Teleport, Summon, and make things explode under his thumb.
In D&D, any ruler powerful enough to last more than a month had best have defenses against magic...either casters of his own as allies or hirelings (dangerous) or in the form of magic warping/dampening fields (tricky) or some such.