See this as an addendum/answer to @LangLangC (iI ran out of characters, otherwise i'd post it as a comment).
Well iI don't think it's that clear cut. First of all, the papal state itself was quite the power in italyItaly, which at the time was a very important region. Italy in the age of communes was among the wealthiest regions and one of the first to recover economically from the fall of Rome. Within the papalPapal state, the popePope wielded absolute secular power and by that measure, was even one of the first absolute monarchies in the modern sense. One such place was also the kingdom of Jerusalem, albeit short lived and not as centralized.
Secondly, such affairs as the walk to Canossa have very strong political power and implications, so much so that it was a setback for the efforts of centralization that the HRE never managed to fully recover from until its dissolution by napoleonNapoleon. The catholicCatholic church could directly and indirectly serve as a stabilizing or destabilizing factor within a country. It could support rival centers of power and bolster legitimacy of its favorite factions.
One could regard the churches and confessionals that Catholicism had as a sort of early intelligence agency, albeit a very independent one. It often gave the church more insight into personal and political situations than its distance would normally allow.
Even after some emperors got away with investiture, the papacy still held investiture rights in other parts of europeEurope (NB: bishops had secular power at the time too!). So it was able to directly place prince-bishops and other secular or semi-secular posts well outside its territory. Simony, on the other hand, could provide funds and influence with local nobility in exchange for such bishoprics. Monasteries and Monastic orders were (and still are!) among the greatest property Moghuls in Europe, often having more land and income at their disposal than powerful Counts and Dukes.
The church had judicial power. Much like shariaSharia law today, the catholicCatholic church held sway over many law-making bodies in Europe. This went as far as the inquisitionInquisition being able to hold independent trials and order local executive power to carry out the sentence.
The church had geopolitical soft power. Often the church was consulted to broker peace and trade treaties, seek legitimacy for some cause or the other, or to arrange marriages and other forms of alliance between countries. Think of how Inter Caetera sparked the treaty of tordesillasTordesillas.