Fr. Hardon explains that the New Testament is quite clear that Jesus founded the Church to be a society for salvation of all men. The ancient Fathers held the unanimous conviction that salvation cannot be achieved outside the Church!
Gradually, however, it became clear that there existed some "God-fearing" individuals who were deprived of Catholic heritage "without fault on their part." It followed that such people were open to salvation, even though they were not professed Catholics, or even baptized.
Thomas Aquinas, however, restated the teaching about the general necessity of the Church. He did concede that a person could be saved "extra-sacramentally" by a "baptism of desire" and therefore without actual Church membership, but the implicit desire to belong to the Church.
The famous Vatican II Council redefined salvation doctrine as follows:
The Council relies on sacred scripture and Tradition in teaching that this pilgrim Church is necessary for salvation. Christ alone is the mediator of salvation and the way of salvation. This means that it would be impossible for men to be saved if they refused to enter or to remain in the Catholic Church, unless they were unaware that her foundation by God through Jesus Christ made it a necessity.
Hardon goes on to write that salvation, then, is possible without baptism, and people may be saved according to their "adequate cooperation with the internal graces of the Spirit they receive." However, he continues, "whoever is actually saved owes his salvation to the one Catholic Church founded by Christ. It is this Church alone that communicates the merits won for the whole world on the cross."