Charlemagne was a king in Europe, who wanted to establish a Christian empire. In 799 Pope Leo III ask for Charlemagne's protection from being removed Charlemagne agreed and was crowned Holy Roman Emperor. As a result the Pope won power to crown emperors and this angers the Byzantine.
I would not do this if I were you.
Charlemagne believe's that God had made him emperor in order to do God's work on earth. Pope believe's that the church had made Charlemagne emperor. In 200 years Charlemagne's coronation.
I excommunicate you
In 1073 Pope Gregory became Pope Gregory VII. King Henry IV was angry. They were ready to battle because king Henry though he should have more power by appointing bishops.
Guess how has the power know
King Henry was mad so get his bishops. Know they both were really mad at each other and didn't know how it would end. People didn't know how to follow.
So the Pope got so mad that he excommunication King Henry from the church. When you get excommunicated you are band for the church and that means you are like not a believer. So People didn't respect him, so he lost power.
After the Pope had all the power. Then King Henry asked for forgiveness. So the Pope did. He gave the emperor to fief or grant land for bishops and King Henry took the Popes power away.