Charlemagne was a devout Christian king who ruled an empire after the collapse of the Western Roman Empire. He set out to improve the Church and made many efforts to do so. He ordered clergy members to live strictly by Church rules, appointed them as advisors, created a library of Christian text, and much more.
This is outrageous!
I have established new rules!
Pope Gregory VII
In 799, Pope Leo III arrived at Charlemagne's empire fleeing rivals in Rome threatening him. Charlemagne sent the Pope back to Rome under his protection after a few months of his arrival. In return, Charlemagne was crowned emperor by the Pope on Christmas Day.
Because of all of the rules you have broken, we have excommunicated you from the Church!
After Charlemagne's coronation, he viewed his crowning differently than Pope Leo III. Charlemagne believed God crowned him emperor. Pope Leo III believed the Church crowned him emperor.
The Pope should be able to appoint bishops but emperors can bribe bishops for their loyalty!
About 300 years after Charlemagne's empire fell and Pope Leo III died, the Holy Roman Empire and Pope Gregory VII rose. The Pope established a new set of rules which were the pope alone could appoint bishops and remove emperors. Henry IV, the Holy Roman Emperor at the time, was outraged and felt it was a direct attack on his own power and rights.
Henry IV ignored the pope's rules by naming his own bishop and trying to remove the Pope from his position. In response, Pope Gregory VII appointed a rival bishop and then excommunicated him. People all across Europe began taking sides.
In 1122, after both Pope Gregory VII and Henry VI died, an agreement called the Concordat of Worms was made between the Holy Roman Empire and the Church. This agreement stated that the Church could solely appoint bishops. However, emperors were allowed to bribe the bishops in order for their loyalty. Though soon after, conflicts arose again.