layman attempt at explaining infallibility
Jesus was infallible through the power of the holy spirit. Though he wavered at times, an example would be when jesus asked his Father to take this cup from me, in order to fullfill his mission, he was strengthen by the holy spirit. He left mere men, the apostles, to create his church and its organization here on earth. Jesus knew, just as God knew, that there would be disagreements. As with any organization, there should be someone in charge of the debate among men, someone with authority. It is plain to see from scripture that Jesus put Peter in that posistion. From the dialogue where Jesus said, you are Peter and upon this rock i will build my church, to where whenever the apostles were mentioned , it was always stated as Peter and the Apostles. He was the first among equals.
In debate over how should scripture be interpreted, or what church doctrine should be, Im sure much imput would be heard amongst the apostles and disciples. Example would be Paul’s appeal to Peter to include the Gentiles without circumcision. Paul appealed to Peters authority and the collective conscionious of the apostles and elders of the church. Now during that debate, im sure that Jesus is watching over the discussion and sends the holy spirit into the discussion to iinfluence the free will of the men in attendence. It may have been what Paul said or what someone else said. In the end, the decision was made by Peter to include the gentiles without circumcision. Jesus will get the right results from important decisions that need to be made by his church. Whether the holy spirit influences the mind of the Bishop direct, or the bishops mind is influenced through the words of someone else, the holy spirit presides over the outcome of church decisions regarding scripture and morals.
Since Jesus said that what you deem on earth i will deem in heaven, He knew that the church he left here on earth would contain some human aspects, but he made sure that the core elements of his church would remain true to his teachings, through the intervention of holy spirit.
The misconception of most protestants is that we believe that the pope to be some kind of super power that is incapable of making a mistake. The pope has the college of cardinals and the bishops , plus im sure, hundreds of scholars who provide discussion and debate over posistions of the church on certain subjects as they come up. With that said, we believe to this day, that the holy spirit, through its intercession of those discussions, reveals the truth through someone, so that the Pope, who has to make a final decision, makes the decision that jesus would want him to make.