Our government consists of officers that must take oaths, precisely because they are public servants. They are not the ultimate authority.
These oaths establish and define these government officers' professional loyalties and limitations in office. They take oaths to the head-of-state, not through some kind of deference to the royal family (in the case of the UK) but more as a promise to uphold the Rule of Law. Why? Because the head of state represents that Rule of Law, the fairness and justice of the system that keeps the people's sovereignty in place. Equity.
The head of state (in a truly legitimate democratic society) promises to uphold the rule of law for the people whether a president in a Republic or a King/Queen in a Monarchy.
A Republic is no more prone to upholding this system of the Rule of Law than a monarchy - a common misconception especially in the United States. As long as the head of state in either situation remains a symbolic representation of the Rule of Law - the upholding of the people's sovereignty through Common Law principles, then a republic or a monarchy can be equally truly democratic. Conversely, a President in a Republic can be just as tyrannical as a King or Queen in a system of Monarchy. That would make that state completely non-democratic regardless of whether elections are held.
This is absolutely critical that people understand this. Democracy has nothing to do with voting in elections: that is called suffrage. Democracy is, instead, all about the people being directly in authority over their government and its legislation (rules of society) through the magic mechanism of full Trial by Jury and the ability to annul 'bad' or unjust government regulation. This defining principle of Democracy is what allows the people to remain sovereign at all times - not merely every four years at elections. But democracy is also about the head of state responsibly sticking to their promise to keep all of that in place and not to ratify government legislation if it clearly falls foul of existing, recognised common law or attempts to tamper with the constitutional structure itself.