According to the book of the Acts of the Apostles in the Bible
According to the book of the Acts of the Apostles in the Bible, when Jesus ascended into heaven, Peter took over leadership of his apostles and other followers. In secular history, though he never officially assumed the title of the bishop of Rome, Peter was recognized as the first pope. Every subsequent pope was recognized not as the successor of the pope that went before but as the successor of Peter. In 1870, 433 bishops at the First Vatican Council reinforced this doctrine when they issued the decree of papal infallibility. This stated that in matters of faith and morals, the pope has supreme authority, and his word cannot be questioned.
The charism of infallibility is exercised only when the pope issues an ex cathedra statement on faith and morals or when he proposes a teaching united with all the bishops of the world. Unlike divine inspiration of scripture, where God directed the sacred authors to write only what he wanted them to write, infallibility means there are no moral or doctrinal errors present in the statement.