Papal infallibility is a dogma in the Catholic Church that presupposes that a Pope can speak no wrong when he propagates doctrines based on religious scripture and tradition. This dogma does not necessarily mean that the Pope cannot sin nor does it mean that it cannot be challenged by other practioners of faith. Instead, the dogma is related to the story of Jesus entrusting St. Peter (the first Pope) with his church, and thus the doctrines of faith or morals issued by the Pope are in his capacity as his successor to St. Peter. Essentially, sourcing the idea of the pope being infalliable due to God's trust to Peter and his successors.
Examples of when papal infallibility was used was when Mary’s immaculate conception of Jesus and her assumption to heaven was placed into dogma, and the ruling of the Catholic Church having to reserve priestly ordination to men alone.