When the Roman Empire became officially Christian in the late 4th century, the Emperor or Emperors were the head (or heads) of the Church. I say Emperor of Emperors because sometimes there was one Emperor, and sometimes there were two, one in the Latin West and one in the Greek East. But then the Western Empire ceased to be in AD 476 -- or so they say. It's a little more complicated than that. Some people still claimed to be the Western Emperor in the years after 476, and there can be a reasonable discussion about how serious some of those claims were. And in the 6th century, Justinian, the Eastern, Byzantine Emperor, warred quite vigorously and won back quite a bit of the Western Empire: the entire Italian peninsula and modern-day Slovenia and Croatia, and Sicily and Sardinia and Corsica and most of the northern coast of western Africa and most of the southern coast of Spain. But the Empire only held of these re-conquests for a few years. The wars which won all that territory also bankrupted the Eastern Empire, and that's why they weren't able to hold onto the territory -- after 476 the Popes moved into the power vacuum left by the disintegration of the Western Empire.
For most of the period between 476 and 800 -- when the Pope crowned Charlemagne as the Western Emperor -- the Popes were the most powerful ruler in Western Europe, they gave the region most of what political cohesion it had, and they continued to be the strongest political power for centuries after 800. There were Emperors again in the West, but they never held the sort of power which Emperors had had until 476, and which the Eastern or Byzantine Emperors retained until 1453. The Byzantine Emperors were the unquestioned heads of both church and state. The Popes were unquestioned as the rulers of the Western Church until the 16th century, and they often contested the position of highest earthly power with the Emperors.
I don't know the details how the use of the term "Pope," to refer specifically and only to the Bishop of Rome, originated and spread. In 1073, Pope Gregory VII officially declared that it would not be applied to any other Bishop in the Catholic Church except for the Bishop of Rome. This had been the unofficial understanding of the meaning of the term for some time already -- for how long? Good question. In the 3rd century, the term "Pope," meaning "Holy Father," was occasionally applied to various Bishops. All I can say for sure is that sometime between the 3rd and 11th centuries, the Bishops of Romes became known as the Popes.
Before 476, when the Papacy began to (partially) fill the role of the Emperors, the Bishop of Rome was just one of several powerful bishops alongside those of Jerusalem, Alexandria, Antioch and Constantinople. The question of which of these bishops was the most powerful was far overshadowed by the fact that all of them were subservient to the Emperor or Emperors. When people claim that Constantine and the Pope re-wrote the Bible at Nicea in 325, not only do they not know that Bishop Sylvester of Rome -- to whom we often in retrospect, anachronistically, refer as Pope Sylvester I -- not only are they unaware that Sylvester didn't actually go to Nicea -- they also assume that he had a distinction above the Bishops of Constantinople and Alexandria and Antioch and Jerusalem, which he didn't have.