I was named emperor to do God's will on Earth, and it is your job to assist me with that.
...Other way around...
Charlemagne was a very devout, Christian king and his goal was to improve the Church and obtain the title of emperor. He ruled with a Christian set of beliefs, and made it so monks, priest's, and nuns were all under his control. Then one day, Pope Leo came to Charlemagne and asked him for help, and in return he would give him a secret reward.
Later in time...
I declare supreme power over all rulers!
King Henry: I don't think so!
The reason that Pope Leo came to Charlemagne was because he was being attacked by his people and therefore fled and went to the king. Charlemagne willingly accepted to helping protect Pope Leo since he needed help. In turn for his protection, Pope Leo, since it was his power, named Charlemagne what he always wanted, the title of emperor. His coronation resulted in the split between the 2 churches and the strengthening of the Western Europe Church.
I'm not changing it!
In the following years, Charlemagne started believing that he was named emperor so that he could do God's work on Earth. He also believed that God had assigned the pope to help him and assist him with this duty. On the other hand, Pope Leo thought that Charlemagne had been named emperor so that he could assist the Pope in doing God's work. Eventually, 200 years later, this disagreement led to a battle between the 2 ideas on which people took sides.
We all agree!
In 1073, a monk named Hildebrand became pope and changed his name to Pope Gregory. When he became pope, he implanted a set of rules saying that the Pope held supreme power over church and secular leaders. This new set of rules upset the king at the time, King Henry IV. This rule was considered an insult because it seemed like a direct attack on the King's own power and rights.
Eventually, this conflict between the king and the pope led to a battle. Because the pope had set these rules, the king felt that he had to do something to get back at him since he wouldn't agree to destroy the law. To do this, the king appointed a rival bishop, since the pope already had a bishop chosen, to go against the other. Once the people of Europe found out, they decided to choose the side of either the king or pope.
Many years after their deaths in 1122, the Church and the Holy Roman Empire made an agreement. This agreement was called The Concordat of Worms and made it so only popes were allowed to appoint bishops, but rulers/emperors were allowed to grant fiefs. This agreement eventually proved to be a success because it stopped the fighting between the 2 parties and gave them something to both agree on for years to come.