I’ve mentioned before that in a D&D world, where magic works, we should trust ceremony. One ceremony I haven’t discussed yet is the anointing of a king. In Africa this was apparently very important: African Civilizations mentions that all the African civilizations studied in the book appear to use religious ideology to support the power of its ruling class. In some places in central Africa, kings were worshiped as recently as the 20th century.D&D, and fantasy in general, tends to be deeply conservative, in that its heroes tend to be the type who support the status quo, or want to return a recent status quo. They oppose evil forces who want to change things for the worse. (Liberal fantasy would be, I guess, about educating the peasants or something: change would generally be regarded in a more positive light.)
Because fantasy is conservative, it idealizes the institution of kingship. The rules of monarchy have the power of natural law.
A king has a lot of political powers, but in a magical world, I think a king has some magical powers too.
a) A king’s blood is sacred. A subject who kills his rightful king will fall under a curse, probably for many generations.
b) A king has ritual powers. A king can perform “speech acts”: appointing people knights and nobles, and probably performing weddings and funerals, too, like the captain of a boat.
b) A king has healing powers. In medieval England, for instance, a king’s touch was supposed to cure tuberculosis. Between this and the ritual powers, a king basically has all the powers of a cleric. Makes sense, since if a king is not in the “leader” role, who is?
c) A king has powers related to national defense. Many kingdoms probably have some magic items or rituals usable only by the true king in defense of the kingdom. Excalibur comes to mind.