In earlier posts (available here and here), I discussed why popes were not automatically "in charge," taking the story up to the twelfth century. Here I discuss some late medieval popes.
Although the Investiture Controversy was officially settled in 1130, disputes continued between popes and emperors throughout the twelfth century. Popes created anti-emperors as the emperors created anti-popes, leaving it hard for people to know who to follow. The English kings, who had mostly stood on the sidelines during the Investiture Controversy, got into major trouble with Rome when Thomas Becket, archbishop of Canterbury, was murdered, apparently at the urging of King Henry II.
Probably the height of papal authority came only with Pope Innocent III (1198-1216). Because the emperor during his time was just a boy, Frederick II, Innocent was able to avoid pope-emperor conflicts and hold councils that, among other important issues, defined "transubstantiation," changed the "forbidden degrees" of incest from seven to four, and recognized the Franciscans and Dominicans.
If Innocent thought that popes were now in charge, however, he was sadly mistaken. A number of heresies broke out during the thirteenth century, people announcing that they understood Christianity better than did the organized church. Even worse, Frederick II defied the popes once he grew up, promising all sorts of things (like going on Crusade or giving up control of Sicily) which he had no intention of doing.
After Frederick died in 1250, popes hunted down and killed all his children and grandchildren, legitimate and illegitimate. Although they had certainly put the emperors "in their place" (future western emperors were very respectful), they had lost much of their moral authority.
Pope Boniface VIII (1294-1303) became pope after his predecessor, originally a holy hermit, resigned as pope (the first man ever to do so and the only one until Benedict XVI in 2013) and quickly died under suspicious circumstances. Boniface at one point declared a Crusade against his own cardinals and made the most sweeping statements of papal superiority ever, before or since.
But when he alienated the French king (Philip IV), the king sent people to arrest the pope "to try him for heresy." Earlier French kings had normally been papal allies, but not anymore. The pope died before any trial could get underway, but for much of the fourteenth century all subsequent popes sought to demonstrate that they were the helpful little friends of the French kings, not even living in Rome but rather in Avignon (southern France).
When in 1378 the pope finally decided to return to Rome and immediately died, the Roman populace clamored for a Roman pope. The terrified cardinals elected one, then, declaring that the election was void because they had acted under duress, they went home to Avignon and elected a different man pope. The Roman pope chose new cardinals of his own.
Now there were two popes, one in Rome and one in Avignon. Europe was divided. France of course supported the French pope and Italy the Italian pope. England, at war with France, supported the Italian pope. Scotland, distrusting England, supported the French pope.
This Great Schism left people deciding that neither was right. A council held to resolve the conflict and to choose a "compromise" pope just ended up creating a third pope. The Schism was resolved finally at the 1415 Council of Constance, but for nearly forty years it had been hard to say who had really been pope, and few people cared anymore.
After 1415, the popes (back in Rome) settled down to become one more Renaissance tyrant. And only a century later, here came Martin Luther and the Reformation.
(By the way, "papal infallibility" was established only in the nineteenth century, not the Middle Ages. And popes have to declare something infallible for it to count. Most of what they say is not infallible.)