In the later Roman Empire and the Middle Ages, the Pope was the leader of the Catholic Church. Whenever there was a question about whether God would like something or not, people could ask the Pope, and he would tell them what God wanted.
According to Catholic traditions (but there isn’t any evidence from that time, even from the Bible), Jesus told his disciple Peter to lead the Church after the Crucifixion, and so Peter was the first Pope, and all the other Popes get their power from Jesus through him. Pope means “father”, as the Pope is the father of the Church family. It’s the same word as our “Papa”.
In the earliest times where we do have any evidence (about 200 AD), the Pope was just the bishop of Rome, like any other bishop in other towns. But because Rome was the capital of the Roman Empire, the bishop of Rome seemed more important than the other bishops. Bishops from smaller towns came and asked his advice about things. When a lot of bishops needed to meet and have a council, they would meet in Rome, where there were good roads, and big basilicas to meet in. Like other bishops, the Pope was chosen by a council of bishops from among the powerful men of the city, and once he had been chosen he would stay the Pope for the rest of his life.
The bishop of Rome, or the Pope, wasn’t the only powerful bishop. The bishops of Alexandria in Egypt, of Jerusalem in Israel, of Carthage in North Africa, and of Constantinople in modern Turkey were also very powerful men. (Women weren’t allowed to be bishops.) But when the Roman Empire collapsed, in the 400s AD, all of those other places were in the Eastern half of the Empire. They still had an emperor there. Only the Pope in Rome was in the part that collapsed. So in the East, the emperor was still mostly the leader of the church. But in Western Europe, people began to think of the Pope as the father of the church. Then the Umayyads conquered Alexandria, Jerusalem and Carthage in the 600s AD. So those places became mostly Islamic. That made the Pope even more important for the places that were still Christian.
When the Ostrogoths lost control of Italy in the 500s AD, the Pope also got to have political power, as well as religious power. In the Middle Ages, the Pope was the ruler of central Italy. One famous pope from this time was Pope Gregory the Great.
But the Pope’s army wasn’t always strong enough to keep control of his kingdom all by himself. The Pope needed help from other armies – usually the French or the Holy Roman Empire, or other city-states in Northern Italy. So the Pope was always making threats or promises and arrangments to get these other armies to help him. One threat the Pope could make was the Interdict, where he would excommunicate an entire country. The Pope put England under the Interdict under King John, about 1200 AD.
Sometimes this kind of help wasn’t enough. In the 1300s, the bishops had a big argument about who should be the next Pope, and two different sides each chose their own Pope. One Pope stayed in Rome, while the other one had to run away and live in Avignon, in the south of France. This argument went on for nearly a hundred years before the two sides managed to agree on who would be the Pope. The time when the Popes had to live in Avignon is called the Babylonian Captivity, because it is like the time when the Jews had to live in Babylon.