Charlemagne was a Christian ruler who wanted to improve the Church. He helped the Pope when he had to flee from Rome. When the Pope reached Charlemagne's court he was given protection.
I alone have the power to appoint bishops!
This is a direct insult to my power!
The Pope after returning from Charlemagne's court under his protection crowns him Emperor. This offended the Byzantine Emperor, as he saw this as an insult. This started the division between the Eastern and Western churches.
Then I will excommunicate you!
I shall remove you from office!
Although the Pope and Charlemagne got along well, Charlemagne thought that it was the duty of the Church to aid the emperor in doing God's work on earth. While the Pope saw it as the opposite, and that because the Church made him Emperor he should help the Church.
Concordat of Worms signed Pope king
200 years later Pope Gregory declared that he had supreme authority over both Church and secular leaders, was one only with the power to choose bishops, and remove Emperors from the throne. King Henry saw this as a direct attack on his powers and rights.
The conflict began when Henry ignored the pope’s rules and chose a bishop for Milan, Italy. To respond to this Pope Gregory appointed a rival bishop. Henry then tried to remove Gregory as Pope but then the Pope excommunicated Henry, and freed Henry’s subjects from their feudal oaths of loyalty to the emperor.
Henry visited the pope in an Italian castle for three days. The Pope forgave him but Henry later got revenge by forcing him from office. In 1122 the Church and the Holy Roman Empire reach an agreement called the Concordat of Worms, which let the Church appoint bishops but the emperors to give fiefs, to bishops to win their loyalty.