Papal infallibility is one of those “hot button” issues that are widely misunderstood. Hopefully this can clarify what it is and where it comes from.
First, what it is not. Papal infallibility does NOT mean that the Pope is somehow perfect or free from sin. Common sense and just a brief look into history would demonstrate that isn’t true and the Catholic Church agrees.
Instead, Papal infallibility means that the Pope cannot error in teaching on matters of faith and morals. That means it’s not about specific practices of the Church but essential elements of the faith such as Christ’s incarnation, the true presence in the Eucharist, Mary’s assumption etc… It’s even more specific than that in that it must be a truth that the broader Church already affirms to be true. A great example is when the Pope declared in 1950 that Mary’s body was assumed into heaven. Her assumption has been written about by theologians and depicted in religious art from as early as 100AD but it was never formally declared an infallible teaching until 60 years ago.
This belief also has a biblical basis. Christ clearly expects the Apostles to be teachers when he instructs them, “to make disciples of all the nations” and “teach them to obey everything I have commanded you” (Mt 28:19-20). Along with this mandate to teach, he promises the protection of the Holy Spirit to “guide you into all truth” (Jn 16:13) and that the Holy Spirit would keep “the church of the living God is the pillar and foundation of truth” (1 Tim 3:15).
One other interesting tidbit is that Popes rarely invoke papal infallibility. The last time it was used was in 1950 (for Mary’s Assumption) and it was another 100 years before that when it was used to declare Mary’s Immaculate Conception.