This is a great question. Let me give you a few points in terms of the development of the church.
First, in the late Roman Empire, the church was fairly weak. As you can imagine, the church was still small and even persecuted at times. For instance, there was a persecution during Decius and Diocletian. When Constantine became emperor and converted to Christianity, the church grew in stature, but it was by no means strong.
As time progressed, the church became stronger and stronger. There was a few reasons for this. First, the church was a stable organization in a context of great change. This stability was a factor of strength. Second, the church preserved learning. Knowledge in this context was power. At one point, the church even rivaled the monarchs, as the pope even coronated kings. Third, we cannot under emphasize the conscience of people, that is, people really believed that the pope was the vicar of Christ on earth. For this reason, there was a healthy fear when it came to the church.
Here is an example. Pope Gregory VII excommunicated Henry IV several times.