What was the Investiture Contest? The Investiture Contest was the conflict between the Church and the State over who had the power to control the appointments that were made within the Church. In 1075 Pope Gregory banned Henry IV from interfering with the Church but Henry resisted this so in 1076 he was excommunicated by the Pope.
Pope Gregory VII believed that the cause of the Church's problems, was the polluting influence of monarchy. He wasn’t interested in going about this diplomatically and instead set about making an example of Henry IV. In 1075 Pope Gregory banned Henry from having any involvement in Church affairs, but this wasn’t effective. So in February 1076 he excommunicated the German king and instructed his subjects to renounce him.
In 1077 in Italy Henry IV agreed to Pope Gregory VII’s rules if he could return to re-establish his power, as rival claimants to his throne had stepped forward. But in 1080 he was excommunicated again for failing to keep to the promises he made in Italy.
In 1122 Henry IV’s son Henry V settled the investiture question with the current Pope (Pope Calixtus II) in the Concordat of Worms, this stated that the king had the right to invest bishops with secular authority (non-religious) but not sacred authority (religious). The result of this is that bishops not only owed authority to the Pope but also to the King.