It's a question that struck me, when asking another question.
Hey! You may be interested in a previous response on the changing role of the papacy from the 5th-11th centuries. Further elaboration on the changing nature of the papacy through the end of the medieval period, which I summarize VERY quickly at the end will probably be needed to answer your question, but I hope this provides some helpful context. edit: /u/thejukeboxhero per the wishes of the automod