If you think the pope has a cool job today—cool hats, rides in the popemobile, fame and fortune—it was even better back in the medieval era. Popes back then were also kings, and not just king of itsy-bitsy Vatican City, but king over big chunks of Italy and France.
And, just like any feudal kings, they had nobles and vassals who paid taxes and raised armies.
Of course the big difference between popes and most other kings was how they got the job—popes aren't hereditary due mainly to that whole celibacy requirement. Instead, the College of Cardinals (excellent ceiling; a lot of red robes) elects the new pope after one dies.
So in the Papal States (that's the pope's kingdom) there's a lot of competition every time a pope comes down with the sniffles or a rash or something. Instead of vying for attention from a royal family the way they did in most countries, the nobles of the Papal States would do whatever they could to get their sons into the clergy and then elected pope.
Innocent III came from a noble family that was pretty much a pope factory. They knew how to do it. The de Contis made nine popes over the years and Innocent III was only about thirty-seven when he was elected…which is way below the average age of most popes when they're chosen.
The spry, non-ancient Pope Innocent III made it the goal of his papacy to take the whole pope/king idea to a whole new level. He figured that, in this whole feudal system of vassals swearing loyalty to lords, that the pope should be the ultimate lord and everyone (including all the other kings) should be his vassals. It was a thinly veiled plot at world domination.
To achieve his dream of being lord of lords and king of kings, Innocent III asserted himself into the business of all the royal families of Europe. He was like a nosy neighbor constantly looking over the fence and telling people what to do…except that if they disobeyed him he'd excommunicate them.
Excommunication was by far the favorite papal tool of the time. Innocent III and other popes used it so often that it nearly lost its meaning. When King John of England was excommunicated for refusing to accept a new Archbishop, he was basically joining a club that already included the king of France, the Holy Roman Emperor, and various other royals who had been excommunicated by the pope for some horrendous offense or another to the soul of Christianity.
And usually the excommunication was lifted after the king said he was very sorry and paid a fine—kind of like a religious traffic court.
The point of all this meddling wasn't to make money or even to make royals behave themselves (as if that would ever happen). It was to show that they were vassals of the pope. Innocent III was picking fights that he knew he could win in order to make clear the fact that he outranked all the other kings.
Once Innocent III lifted an excommunication, it meant that he had a loyal follower—a king who publicly admitted that he was inferior to the pope.
In exchange for this loyalty, Innocent III would protect that king in much the same way any lord protects their vassal. So when King John claimed that he was forced to sign some crazy document that might take away his power to be as big a jerk as he wanted to be, Pope Innocent III stepped in to put an end to it.
He declared the Magna Carta null and void and excommunicated the rebel barons for overstepping their place. Only the pope could tell the King of England what to do, not a bunch of lesser nobles.
Other popes before and after Innocent III had similar strategies for accumulating power, but not all of them. Some considered the papacy as being more of a religious job. Notably, subsequent popes took a more neutral stance toward later versions of the Magna Carta, rather than excommunicating everybody who touched it.