Pre-enlightenment monarchs believed that they were God's actor upon earth, and so could more or less do as they please, and were above the rule of law (if applicable). This right, granted by God, allowed them to be in a position of unlimited and unchecked power.
This was dissolved more or less during the Enlightenment, either via the weakening of religiosity, monarchs having their powers checked by government through reform and a shift towards enlightened monarchs relying on philosophy, not religion to define their ruling style