In the XIV-XV centuries. The royal power grew very strong and took control of the local church. French King Philip IV Beautiful even moved the papal capital from Rome to the French city of Avignon. “Avignon Prisoner” Dad lasted 70 years.
Back in the XIII century. the order of election was changed so that secular authorities could not interfere in the course of elections. The cardinals who elected the pope were locked in the room on the key and kept there almost starving, until they agree, who should be the pope. Having fulfilled their duty, the cardinals lit a fire in the fireplace, the smoke from which meant that there was already a new dad and it was time to take care of voters.
However, nothing could protect the election of popes from interference of secular power. Monarchs, as before, sought to drag their people to the papal throne. This led to the fact that in the second half of the fourteenth and the first half of the fifteenth centuries, for almost 40 years, there were 2-3 popes in Europe at the same time. To change something for the better in the church organization the popes did not want. This led to the indignation of many in Europe and in the 16th century. gave rise to a massive anti-Papal movement. Thus, at the decline of the Middle Ages the papacy completely lost its former power.