In eleventh-century Europe a bishop was two things at once: the spiritual head of a diocese and the holder of substantial lands, revenues and jurisdiction. Kings and emperors appointed them accordingly, and invested them with the ring and the pastoral staff, the symbols of spiritual office. To a reforming party in the church, this was laymen giving away what was not theirs to give, and it stood behind everything else they wanted to correct: bishops appointed for political usefulness, offices bought and sold, and a clergy answerable to secular power.
Gregory VII pressed the point to its conclusion, prohibiting lay investiture and asserting in a famous set of propositions that the pope could depose emperors. Henry IV, whose government depended on appointing bishops, responded by declaring Gregory no true pope. Gregory excommunicated and deposed him, releasing his subjects from their oaths, which in a kingdom of restless magnates was a serious weapon.
The dispute ran for nearly fifty years and through several popes and rulers, with antipopes, armies and a sack of Rome along the way. It was settled at Worms in 1122 by dividing the question: the church would invest with ring and staff, and the ruler would invest with the temporal regalia, receiving homage for the lands. Similar compromises had already been reached in England and France.