Through a series of events largely outside of Martin Luther's control, he found himself scheduled to debate John Eck, a noted Roman Catholic theologian, in the summer of 1519. What has come to be called the Leipzig Debate marked a shift in Luther's criticism of the Roman Catholic Church. The precipitating event was Luther's defense of some positions of Jan Hus, the Bohemian proto-reformer who was burned at the stake more than 100 years earlier. Interestingly, Luther defended Hus' theology only after Eck had debated Luther into a corner.
"In the course of the debate, Luther eventually responded to the claim that he was supporting a condemned position by defending many of Hus’s positions as essentially orthodox. When Eck questioned his defense of a noted heretic, Luther countered that the Council of Constance, which sentenced Hus to death, could have been in error. This led him to state that councils could and had erred, as had popes and canon law. What remained infallible for Luther was Scripture and thus it was finally authoritative for the church."
And so, when presented with the choice of supporting the Roman Catholic Church or the heretic Jan Hus, Luther chose the heretic. "For the first time, Luther had articulated clearly his position that popes, councils, and theologians were all subject to error, leaving Scripture as the supreme authority in all theological matters. This became a watershed moment, resulting in both increased support and increased opposition after he left Leipzig."
Thus, the formal principle of the Reformation was established. The arguments between Roman Catholics and reformers would be debated from there on the grounds of this question: how do you know that Scripture is the supreme authority? As the Reformation continued and expanded, other reformers would add clarity to what it means for Scripture both to claim and to be the ultimate authority. John Calvin remarks,
"When that which professes to be the word of God is acknowledged to be so, no person, unless devoid of common sense and the feelings of a man, will have the desperate hardihood to refuse credit to the speaker. But since no daily responses are given from heaven, and the Scriptures are the only records in which God has been pleased to consign his truth to perpetual remembrance, the full authority which they ought to possess with the faithful is not recognized, unless they are believed to have come from heaven, as directly as if God had been heard giving utterance to them."
Scripture's authority is founded on God's choice to leave a permanent record of his revelation in writing rather than to engage in continued direct divine revelation through the ages. How do you know God's will for your life? He has preserved his revelation in Scripture and Scripture alone; Scripture declares itself to be the very word of God.
Fast forward a few hundred years. While the Dutch Reformed theologian Herman Bavinck was writing his Reformed Dogmatics at the turn of the 19th century, this same issue persisted, yet the questions were more sophisticated. One such Roman Catholic response to the formal principle of the Reformation was this question: how do you know that you know Scripture is the supreme authority? After all, Scripture has always been interpreted by authority, e.g. Moses, the Levitical priests, Christ, and the Apostles. If Scripture needs authoritative interpretation, it can't be clear. If it's not clear, how do you know that it is the supreme authority? So the argument goes.
"The Reformed defense of the formal principle of the Reformation is presented well by Bavinck:
The doctrine of the perspicuity [clarity] of Holy Scripture has frequently been misunderstood and misrepresented, both by Protestants and Catholics. It does not mean that the matters and subjects with which Scripture deals are not mysteries that far exceed the reach of the human intellect. Nor does it assert that Scripture is clear in all its parts, so that no scientific exegesis is needed, or that, also in its doctrine of salvation, Scripture is plain and clear to every person without distinction. It means only that the truth, the knowledge of which is necessary to everyone for salvation, though not spelled out with equal clarity on every page of Scripture, is nevertheless presented throughout all of Scripture in such a simple and intelligible form that a person concerned about the salvation of his or her soul can easily, by personal reading and study, learn to know that truth from Scripture without the assistance and guidance of the church and the priest. The way of salvation, not as it concerns the matter itself but as it concerns the mode of transmission, has been clearly set down there for the reader desirous of salvation."
The Holy Spirit opens blind eyes to the clear truth of Scripture. This clear truth is infallible truth because Scripture is the very word of God. Though councils and popes have erred, Scripture cannot err. So, Scripture is the only solid ground upon which we can know God. This is why sola Scriptura was the formal principle of the Reformation.
As we remember the Reformation this Sunday, remember specifically the formal principle of the Reformation.
 Institutes, 1.7.1
 Reformed Dogmatics, 1:477