The entire struggle between the Pope and the King started when Pope Gregory disapproved of a Bishop that the King had assigned and then the king got offended because he thought that the pope was questioning his authority.
As a result the king decided to convince the German bishops on removing Gregory as the Pope. So Pope Gregory excommunicated king Henry and called on the nobels to overtake the king.
After King henry got excommunicated he went to Italy to beg for forgiveness from the Pope, but Pope Gregory didn’t accept to see him. So king Henry waited in the snow until the pope agreed to see him.
Three days passed until Pope Gregory agreed to see King Henry. When he saw the king the Pope accepted the his apology and communicated him back in the church.