There is a lot about history that is forgotten, or simply not taught. History itself is often not dispassionate as it would be if it were pure science.
Politics was very much a contacty sport before the invention of democracy. The rise of nationalism in Europe would have seen a passing of power from a papal theocracy to ruthless kings and lords who knew what they wanted and who was standing in their way.
If yours is a correct reading of history, it is good to see to the role that pope might take when faced with overhelming power. "Give to Ceasar what is Ceasar's, and give to God what is God's would see the popes exercising their power through religious influence and the prestige of the office over the hearts and minds of Christians, once the sword is no longer available to them.
This is an important perspective to make note of, as we move forward to Trent, and the event of 1870...
I agree with your take on the rise of nationalism vs. papal theocracy. I've been studying the ebb and flow of this in the years 1000-1300 C.E. It is interesting that this was a constant battle roughly from the end of the Carolingian dynasty in Gaul to 1870. The Popes were constantly trying to find one military power after another to back them. They realized that the meager military that they commanded could not stand against any national force. So compromise after compromise on the political fronts were made. The enemies they faced were daunting and it is truly a miracle that the nearly 2000 year history of the papacy did not end long ago. As a Catholic, I see the hand of God in the preservation of the papacy.
It is interesting to view hegemony in both the political and religious arenas. In the years after the fall of the Roman Empire, as roads deteriorated and Rome's military power could no longer be counted on to defend the citizens, political hegemony shrank to very small areas, roughly how far you could sally forth in one day's march. To be caught in the open invited your neighbors to attack you.
Oddly as political hegemony shrank, religious hegemony increased. Rome left not just a unified political structure; but a fairly unified religious structure. Constantine gets a lot of grief from Non-Catholic and Non-Orthodox circles as the person that started the syncretism of pagan Rome with Christianity. To me that is pure bunk. Constantine understood, as a general on the frontiers of the Roman Empire, that the only way for the Empire to last was through unification of military, political, and religious power. Today, each Catholic Bishop is in charge of a diocese, a word that used to mean the political area ruled in the Roman Empire by a local authority. As Rome's military and political power waned, the citizens often looked to the religious authorities to fill the vacuum.
As nations reunified many centuries later, they started disliking the influence the Pope had in their areas. They disliked the money that was donated to the church and taken out of their country to Rome. They disliked having the Pope select the local bishops. They disliked the fact that the church had started thriving businesses within their kingdoms and these were not subject to taxation (similar to what has happened in the U.S. where many churches have not-for-profit schools now). As the nations gained power, it was a foregone conclusion that the papacy would lose temporal power.
In regards to the Pope wielding power by the sword, I haven't found many instances of this. I agree with your thought that their power derived from the religious influence that they could exert. They ruled by the heart, not the hand. When they alienated the people to the point their hearts strayed, there was little they could do. Trent is an interesting case. It could declare anathemas that could be used as guidelines for Catholic orthodoxy; but that did nothing to sway the hearts of the people the anathemas were directed at. If you see the Inquisitions as the Pope wielding a sword to keep the people in line, then we have to get away from my big brush stroke history and into the many details of the several Inquisitions throughout history.
This is all a side issue to papal infallibility though. The Popes have never claimed any form of infallibility when it comes to the political arena.
What would be a concern is that infallibility leads not to just better definition, but intractable definitions making change impossible.
I was referring to 1870 and having a better definition of what constituted infallible papal documents. To me, a good analogy would be to the canon of the Bible. Before the late 300's, there were many documents that purported to be scripture. Many of these were read in local churches as though they were. The councils that decided the canon had to come up with a test that could be applied to sift out the best of the bunch and reject those that were not. I find it illogical to say that God inspired men to write infallible documents; but did not inspire the men that decided the canon to know what documents were infallible. The documents did not change, only their status as canonical. This standardized what could be read in the various churches. One can say that the Holy Spirit was the influence behind all of this; but one cannot deny that the Holy Spirit used men to determine this truth.
Papal infallibility works in the same way. It is never meant to invent new dogma; but only to recognize that which already exists. The charism is protected by the Holy Spirit; just like that same Spirit protects the ecumenical councils.
That is why I find your OP to be interesting. It is aimed at the heart of the matter. Can we show historically the continuity of the beliefs that have been declared infallible? You are certainly true in stating that much of history has been lost, particularly the early church history. If the Roman suppression didn't destroy it, waves of Vandals did. We are left glimpses only.
I would be perfectly comfortable actually with defending a Catholic Church, acknowledging the excesses of the past for sure, but also understanding that no one here is in a good position to judge Christians of the past either. For sure future generations will look just as harshly on our excesses mistakes and evil as well.
A historic perspective is good and it is what places all papal decisions, all councilar decisions, and the ways of the past in the necessary context. As often as not, the decisions were made because they had to be made to meet the challenges of that day. Politics and the art of compromise were at play, because then as now were in love with the Gospel and wanted its main messages to thrive and grow. Infallibility dogma takes the words of the past out of the past and sets them in eternal stone.
What would be interesting is to note how infallibility dogma is likely has a context too, namely Garibaldi and the liberation of the Papal States, and with that the complete eradication of the papacy as a secular power.
Given the history of the Unam Sanctum, and the similar papal pronouncements in the wake of the threat to papal power and prestige posed by the Reformation, should we surmise a coincidence from these pronouncements, or a trend?
It is interesting that you referred to it as the "liberation" of the Papal States as though the Pope had recently conquered these areas and they were being returned to the rightful authorities. Protestant History has painted that picture of the Popes as greedy, power hungry men clutching at the last vestiges of their temporal power. You have brought up an interesting point, though. Were Vatican I and Trent merely reactionary councils to try and solidify an eroding power base? I will throw that question out to the people reading this forum. This strikes at historical cause and effect which can be a murky thing.