Is it realistic for a rather well-to-do city to accept a monarchy over democracy simply for a promise of protection at the cost of higher taxes given baseless rumors of invasion?
Setting is medieval Europe.
Yes, feudalism was born so. Dictatorships sometimes are born so. If the danger is felt very strongly by the population and the king appears to be the one who can save them from it, people can renounce freedom and accept higher taxes in order to be protected and safe. However, a lot depends on 2 things: the history of the city and the taxes. A city which has been a republic for much time would not accept very well a monarchy unless it is the only way to be safe form dangers. If the taxes imposed by the king are too high, rebellions are much more likely to happen.
So, summing up, a city would accept monarchy if the danger is felt very strong and the king seems to be the best/the one who can keep them safe. But if the king is silly and impose too high taxes or if the city has a well-felt history of democracy, then rebellions are likely to happen, even if people are scared of invasions (they could see them as liberators).
I'm not sure if baseless rumors would be enough, considering how good people are at pretending things are ok when they are not.
It kind of depends on the nature of the threat, and how much fear mongering is happening around the city.
A vague, undefined threat will be ignored for a while, but with constant rumors and news circulating it will slowly increase stress until people decide something should be done.
So why would the people look for a king instead of just handling it through democratic channels?
Well, one reason would be a lack of confidence in their current leaders.
Say there is a really vague threat, but a lot of people are really nervous about it. So they go to the senate and say "we want to raise an army!"
The leaders don't think that the threat is real enough to divert money from city upkeep, and so they put off voting on it.
The people get mad and decide that if the current leaders won't do something about it, they'll get one who will, by golly!
Another consideration is how the common people feel about having a king
I remember an example of a nation that was ruled by judges who took office for a while, and then stepped down when their time was up. It was mostly a way for larger disputes to be handled, and for some basic organization of the nation, but otherwise the people kind of governed themselves. Then there were a few corrupt judges.
After a while the people started looking at all the nations around them and started asking "why can't we have a king? Real nations have kings and ceremony and big armies to fight for them." and the reply was "well, you can, but if you do the king will make taxes, take your sons to raise armies, your land for himself, your livestock for food, and other stuff you don't have to worry about now." and the people said “We want a king. Then we will be like all the other nations, with a king to lead us and go out and fight our battles.”
So if they have king envy, even if their current system is working ok, then they are a lot more likely to think a king will solve their problems.
Harvest failed? A king would know what to do.
Raider attacks? We're only weak because we don't have a king.
Next nation over rattling the saber? They wouldn't dare if we had a king to stand up for us!
It might also happen gradually
I remember another story about a democratically elected leader that used fear and vague threats of war to gather more power. He was very charismatic and conniving. By pulling strings and fanning rumors from the shadows, he was able to convince the senate to give him the authority to raise an army and use it to protect the nation. He also made moves to remove his political rivals and others that might stand in his way. Eventually he had so much power that he was able to dissolve the senate and be the undisputed ruler.
While the answers are all very good, there is one point they have overlooked: the power of the monarchy to simply force itself on the city-state.
If the people in the city fear a putative invasion enough to be willing to place their own security in the hands of an outsider, then one of the factors influencing the decision is a realization that the local militia/city guard/hired mercenary troops or whatever the city is using to protect itself is not capable of dealing with the new threat. When the King offers to step in and take over with the Royal forces because they are capable of dealing with the threat, then the citizens will calculate that the King's army is also powerful enough to sack the city and take everything from them by force.
A historical example is the Italian city states in the Renaissance. They were fortified and had local militias backed by whatever mercenary bands that could be hired in order to protect their autonomy and have enough force to lean on their neighbours if the local rulers desired. (Venice is an exception, being the only true Republic of the period and also being a naval power). While the situation was relatively stable so long as the Italians fought amongst themselves, once outside powers moved in to seize the wealth of Italy, the individual city states were overwhelmed.
The factors are somewhat different from your story (the city states refused to cooperate with each other and often tried to play both sides of the coin with the invaders, generally a bad idea when the invaders discover your double dealing....), but the end results were the same; the overthrow of the ruling families and incorporation of the city states into other polities or empires. If your setting is similar, once a few city states are made examples of, the citizens of the rest should be persuaded to see things the King's way.
Cities which have the ability to resist will most likely decide to stand against the King to protect their own autonomy, property and wealth. Venice, being a naval power and protected from invasion by terrain remained independent until Napoleon finally occupied the city in the 1700's, and in a different context, Dutch cities in the United Provinces used a combination of fortification, flooded terrain and a fanatical rejection of Catholicism to defy the Imperial Spanish armies during the 1500's. The fact that the United Provinces had access to the sea and were able to establish a commercial "empire" provided the financial means to continue to defy Spain for quite some time. Even farther back in history, Athens defied both the Persian Great King and Spartan Kings by being able to use their sea power to bring wealth and food to the city, and project forces outwards. (The common denominator is using sea power to access wealth, food and resources. It may be possible to do this trick without access to the sea, although it would be much harder).
Some extraneous factors might also skew the calculations of the citizens. If they are in the grip of a religious fervour or other mystical belief system which assures them they will prevail, then they will attempt to resist despite the odds against them. Jewish defenders of Jerusalem fought the Roman Legions despite the odds being heavily against them, and saw the Temple destroyed and the Jewish people scattered to the winds. The Cathars were crushed during the Albigensian Crusade for much the same reason (although their belief system seems to have encouraged some of them to seek martyrdom as a means of spiritual release from the material world).
So there will be a certain amount of calculated self interest involved when the citizens decide if they will surrender their privileges to become subjects of the King.
You might want to look up the story of Cincinnatus. The term "dictator" originated in Rome. Sometimes, when they thought that a problem required a singular authority, they replaced their co-consuls with a single dictator. The dictator would rule for a period of ten years with greater powers than the two consuls would normally have.
Most of the dictators would stay through the end of their term and take advantage of the power that the position gave them. Cincinnatus was famous for twice leaving promptly after the immediate crisis was finished.
Anyway, the point is that this is quite possible. Ancient Rome had something like you describe built into their system. Presumably this came about in response to some original issue and developed into the more polished system. So it seems quite possible that another democracy might arrive at something like what you describe.
That said, note that people still may find specific examples to be unrealistic. For example, a medieval European city would be more likely to already have a feudal government.
It may help to give the example of another nearby city that already has a feudal leader that shows success in avoiding being conquered and a third democratic city that is conquered. However, that might make the fears less baseless and be undesirable on that basis.
Higher taxes aren't necessarily bad. The reason we continue to have taxes at all is so that the government can build infrastructure and common goods/services such as armies.
A city or state or country giving up self-rule in order to be part of a larger nation is also not unheard of. For example, Puerto Rico wants to join the US as a state. There has been talk of Turcs and Caicos joining Canada. East and West Germany unified after 1989. And practically every modern nation grew out of smaller political entities that consolidated over time.
So, yes, this is plausible, but the specifics of how it happens in any particular case will depend on the situation at hand. The United States was formed from several independent colonies, as was Canada, though the specifics differ: one was through revolution and then uniting against a threat, the other was through a democratic process to improve self-rule.
It's also instructive to look at how larger groups work. Sometimes you have empires, formed usually by conquest, where several nations are ruled together by one nation. Or you have the US, where (arguably) several nations got together to form a bigger one. Or you have the EU, where several nations got together to form something that is nation-flavoured (it has its own government and currency but the member states are still more autonomous than provinces normally are). You even have cases where "nations" are as small as a few blocks of a larger city: c.f. Vatican City, which operates as if it is its own nation but is really more like a part of Italy.
In short: all kinds of arrangements are possible and people will change those arrangements whenever their reasons for doing so outweigh the costs.
Yes, of course. In history, you'll find a lot of societies that went from republic/democracy to dictatorship or oligarchy. Sometimes through a military takeover, sometimes through gradual political change. For example, look at the birth of Nazi Germany. Look at the development of modern Turkey from Atatürk to Erdogan.
Look at the impact of propaganda and how propaganda is made. Look at conspiration theories and how they might destabilise a government.
Maybe look at Chile under Allende and how the events turned towards dictatorship.
If everything is in order a aspiring monarch will have much more trouble to overthrow the government but it still isn't impossible. It would need some 'evidence' even manufactured evidence, to make the threat of invasion believable.
Maybe aggression against traveling traders, a massacre .. anything that can be formed into good propaganda.