I think someone had a question about this, but even if not, it’s always a good thing to think more about.
Infallibility refers the the charism that “Christ endowed the Church’s shepherds” (CCC 890) for the preaching of “the Gospel of God to all men in keeping with the Lord’s command” (CCC 888) and preserving “the Church in the purity of the faith handed on by the apostles” (CCC 889). The pope, as the head and supreme pastor has this charism in a particular way when he pronounces definitively a teaching (doctrine) on faith and morals. In no way does the “papal infallibility” refer to the pope’s holiness, or correctness as a person in any other respects. I would even go as far as to say that it doesn’t apply to even his personal philosophy or theology! (Although for the popes in my lifetime, I submit to their philosophy and theology)
Keep in mind that this charism only applies to definitive teachings on faith and morals. In the whole history of the Church, only 2 teachings have ever been proclaimed “ex cathedra” which means literally “from the chair” or the chair of Peter, his teaching office, using the full extent of the gift of this papal charism making the teachings infallible. All other teachings have either been handed down through Tradition or Sacred Scripture, or with the whole of the Magisterium (the teaching body that is the bishops in unity with the pope). It’s my understanding that many of the teachings that the Church as “proclaimed” were actually clarified and the source of the teaching was from Tradition, that it was believed inherently by the faithful in the past, but never clarified. It seems that’s usually the case that teachings are passed down and only clarified when challenged. It makes sense because these teachings aren’t arbitrarily invented, rather they are passed down from the source who is the person of Christ and his Apostles so many years ago.
The reason why the pope has this particular charism is because of the nature of his office as the supreme and universal pastor. The main Biblical evidence of the pope’s office seems to come from the episode after Peter’s confession to Jesus’ question “Who do you say that I am?” Textual evidence comes from all the instances that Peter spoke for the Apostles as a group before and after the Resurrection (going fishing in Galilee, having the last word when Paul asks about the Gentiles, which by the way was the first ecumenical council). We must keep in mind that this charism is not something that is taken casually. I think it makes most sense when we see the office of the pope for what it is: the Servant of the Servants of God ultimately “for care of souls” (CCC 937).
Personally, I think having a pope makes practical sense. If you ever study leadership, there must always be one person in the end to make a decision or to execute it; even groups have a chair person or someone presiding. For the Church, even on the human level, this means one person in the end must make decisions, break ties, and be responsible. In God’s divine wisdom, Jesus protected the office of the Pope with this charism so that we can know that we can trust the pope even though he’s human. I consider it a miracle that there have been clear scoundrels that have held the office of the pope in the Church’s history, and yet, the teachings on faith and morals have not changed at all since the beginning! Using Peter Kreeft’s analogy, if a mirror told you you were ugly, why not change the mirror or break it? In the same way, the scoundrel popes knew by the Church’s teachings they weren’t holy men, and yet they didn’t change the teachings.
On a practical level, I find that having a pope with ultimate authority as the Vicar of Christ is hugely humbling and a constant call to obedience (CCC 891). For me, it’s a reminder that God has not left us orphans. On the flip side, it’s a reminder that I have to realistically change my life to conform to the teachings of the Church, which for me, the pope personifies and inspires me towards. Thanks be to God for this gift of protection for His holy Church!