The clash between Pope Gregory VII and King Henry IV.
In the middle ages, the pope was the head of the Christian Church in Europe. If the pope thought someone was working aginst the church he could excommunicate them. Most of Europe was divided into 1000 states and those states were ruled by kings. Some of those kings had little to no power.
The kings Inherited their thrones from their fathers. Sometimes, the king nobles would rebel against the kings but the king would usually establish order rather quickly. They maintained this order through alliances as well
My son I now grant you as the king.
In the mid-1000s, popes tried to increase their authority. They believed all religious officials should anwser to the pope. Among those who believed this was Pope Leo IX, who became a pope in 1049. He argued that because the first pope, saint peter had been the leader of the whole Christian Church, so later popes should be as well.
All popes should be the leader of their whole Christian church.
In 1073 a new pope came to power in Rome his name was Pope Gregory VII. Then trouble arose when Gregory disapproved of the bishop chosen by the Holy Roman Emperor Henry IV. Henry then convinced Germany's bishops that they should remove pope Gregory. Gregory responded by excommunicating King Henry.
You have been excommunicated from the Church.
After both Pope Gregory VII and King Henry IV died the fight over the right to choose bishops continued. In 1122 a new pope and emperor reached a compromised. They agreed upon Church officials would choose all bishops and abbots.