Pope Gregory died leaving Henry iv to do as he pleased
Henry crossed the freezing Alps to the Italian town of Canossa. He approached the castle where the Pope Gregory VII was a guest and then begged humbly to be forgiven.
Which Henry and which pope? There has been more that one conflict involving a Henry and a pope.
Pope Paschall I
Pope Gregory VII
In a nutshell:Henry declared himself head of the Church in England and granted himself a divorce from Catherine of Aragon. The pope then excommunicated him.
King Henry and Pope Gregory
The Lay Investiture Controversy was ultimately resolved through the Concordat of Worms in 1122. This agreement between Pope Calixtus II and Holy Roman Emperor Henry V established that the pope had the authority to appoint bishops and abbots, while secular rulers retained the right to invest them with symbols of their temporal power. This compromise helped to separate the spiritual and temporal powers in the church and ended the conflict over who had the authority to appoint church officials.
pope Gregory VII wanted to change the rules about the religion. Henry IV got angry and thought he can fire pope Gregory VII. Henry got excommunicated from the church. years past, he came back and begged for forgiveness and was back in the church society.
The pope and Henry had a slap fight, then Henry passed the act of supremacy which granted the king power over the pope, allowing him to marry anne Boleyn
Henry IV became Holy Roman Emperor in 1070 A.D., and Hildebrand became Pope Gregory VII in 1073 A.D., he forbade lay investiture in 1075 A.D.. A synod at Worms attempted to depose the Pope in 1076 A.D. and the Pope excommunicated Henry and the Bishops later that same year. In 1077 A.D., Henry said he was sorry and submitted to ecclesiastical penance.
An argument went on between Gregory and Henry. This argument was on whether Henry or Gregory should choose the next Bishop. Gregory got rejected by the Roman's on whether he should pick the next Bishop because of Henry. So Gregory "Excommunicated" Henry. Henry then traveled to Italy to apologize to Gregory. Before Gregory forgave him Henry stood out in the snow for three days out side of Gregory's room.
The issue was the Investiture Controversy, the question of who had the right to choose new bishops.