“The remoter origins of the theory (Divine Right of Kings) are rooted in the medieval idea that God had bestowed earthly power to the king, just as God had given spiritual power and authority to the church, centering on the pope.”
Nonetheless, in the Middle Ages, it was the Church that physically lowered the Crown onto the head of Monarch at the time of coronation, symbolizing that it was the Church, and ultimately the Pope who, while not always claiming political authority, claimed ultimate spiritual power over the monarchs, and thus in the end superiority.
But other than the threat of excommunication, the Pope had no real power. The Emperor Conrad ignored his excommunication completely, and there were others. Napoleon was not the first to diss the Pope . . .