It is of course true that how God does this is a mystery which he has not revealed. So the Catechism says,
The Church does not know of any means other than Baptism that assures entry into eternal beatitude; this is why she takes care not to neglect the mission she has received from the Lord to see that all who can be baptized are "reborn of water and the Spirit" (CCC §1257; emphasis added).But the desire of the catechumen is one that we can only reasonably describe as being pretty explicit: he has sought to become a member of Christ's Church, and is prepared to do and to receive whatever is necessary for that.
For catechumens who die before their Baptism, their explicit desire to receive it, together with repentance for their sins, and charity, assures them the salvation that they were not able to receive through the sacrament (ibid., §1259).It ought to be said, though, that not merely explicit desire for baptism is recognized by the Church, but even an implicit one.
Every man who is ignorant of the Gospel of Christ and of his Church, but seeks the truth and does the will of God in accordance with his understanding of it, can be saved. It may be supposed that such persons would have desired Baptism explicitly if they had known its necessity (ibid., §1260).Aquinas' teaching on this subject is consistent with it.
As stated above (1, ad 2; 68, 2) man receives the forgiveness of sins before Baptism in so far as he has Baptism of desire, explicitly or implicitly... (ST III Q69 A4 ad 2; emphasis added).To be sure, the examples and references St. Thomas makes here don't quite say anything ... explicit ... about implicit desire for Baptism. But it seems to me that it would be a mistake to say that by "implicit" desire he means only the sort of desire he describes in those references. As far as I can tell, it's not rational to say that a catechumen should be described as having an "implicit" desire for Baptism. To the contrary, his desire is explicit. So I think it's reasonable to say that an implicit desire must be the sort of thing that the CCC describes - as when a man is ignorant of the Gospel, but would have accepted Baptism had he known about it. This, it seems to me, is consistent with what we say about implicit faith: the Catholic doesn't have to understand or be able to explain Nicene orthodoxy, but he must have the intention of believing what the Church teaches.
Well, a man who has never heard of Christ can't be said to have an explicit intention to believe what the Church teaches, obviously. But does that mean he has no hope? The Church says that it does not mean that at all. And although the Church knows of no other means of salvation apart from Baptism, she also says "God has bound salvation to the sacrament of Baptism, but he himself is not bound by his sacraments" (CCC §1257 again; emphasis added). Aquinas' acknowledgment of implicit desire for Baptism seems entirely consistent with this. I also think, by way of being self-referential, that this is consistent with what I wrote earlier today about Christ's implicit headship over the whole human race.