something quite informative i juz dug out
Theologians distinguish a twofold necessity, which they call a necessity of means (medii) and a necessity of precept (præcepti), The first (medii) indicates a thing to be so necessary that, if lacking (though inculpably), salvation can not be attained, The second (præcepti) is had when a thing is indeed so necessary that it may not be omitted voluntarily without sin; yet, ignorance of the precept or inability to fulfill it, excuses one from its observance. Baptism is held to be necessary both necessitate medii and præcepti. This doctrine is rounded on the words of Christ. In John, iii, He declares: "Unless a man be born again of water and the Holy Ghost, he can not enter into the kingdom of God." Christ makes no exception to this law and it is therefore general in its application, embracing both adults and infants. It is consequently not merely a necessity of precept but also a necessity of means. This is the sense in which it has always been understood by the Church, and the Council of Trent (Sess, IV, cap, vi) teaches that justification can not be obtained, since the promulgation of the Gospel, without the washing of regeneration or the desire thereof (in voto), In the seventh session, it declares (can. v) anathema upon anyone who says that baptism is not necessary for salvation. We have rendered votum by "desire" for want of a better word. The council does not mean by votum a simple desire of receiving baptism or even a resolution to do so. It means by votum an act of perfect charity or contrition, including, at least implicitly, the will to do all things necessary for salvation and thus especially to receive baptism, The absolute necessity of this sacrament is often insisted on by the Fathers of the Church, especially when they speak of infant baptism. Thus St. Irenæus (II, xxii): "Christ came to save all who are reborn through Him to God,infants, children, and youths" (infantes et parvulos et pueros). St. Augustine (III De Anima) says "If you wish to be a Catholic, do not believe, nor say, nor teach, that infants who die before baptism can obtain the remission of original sin." A still stronger passage from the same doctor (Ep, xxviii, Ad Hieron.) reads:"Whoever says that even infants are vivified in Christ when they depart this life without the participation of His Sacrament (Baptism), both opposes the Apostolic preaching and condemns the whole Church which hastens to baptize infants, because it unhesitatingly believes that otherwise they can not possibly be vivified in Christ," St. Ambrose (II De Abraham., c. xi) speaking of the necessity of baptism, says:" No one is excepted, not the infant, not the one hindered by any necessity." In the Pelagian controversy we find similarly strong pronouncements on the part of the Councils of Carthage and Milevis, and of Pope Innocent I. It is owing to the Church's belief in this necessity of baptism as a means to salvation that, as was already noted by St. Augustine, she committed the power of baptism in certain contingencies even to laymen and women. When it is said that baptism is also necessary, by the necessity of precept (praecepti), it is of course understood that this applies only to such as are capable of receiving a precept, viz. adults.
The necessity in this case is shown by the command of Christ to His Apostles (Matthew 2
: "Go and teach all nations, baptizing them", etc. Since the Apostles are commanded to baptize, the nations are commanded to receive baptism. The necessity of baptism has been called in question by some of the Reformers or their immediate forerunners. It was denied by Wyclif, Bucer, and Zwingli. According to Calvin it is necessary for adults as a precept but not as a means. Hence he contends that the infants of believing parents are sanctified in the womb and thus freed from original sin without baptism. The Socinians teach that baptism is merely an external profession of the Christian faith and a rite which each one is free to receive or neglect. An argument against the absolute necessity of baptism has been sought in the text of Scripture: "Unless you eat the flesh of the Son of man and drink his blood, you shall not have life in you" (John 6). Here, they say, is a parallel to the text: "Unless a man be born again of water". Yet everyone admits that the Eucharist is not necessary as a means but only as a precept. The reply to this is obvious. In the first instance, Christ addresses His words in the second person to adults; in the second, He speaks in the third person and without any distinction whatever. Another favorite text is that of St. Paul (1 Corinthians 7): "The unbelieving husband is sanctified by the believing wife; and the unbelieving wife is sanctified by the believing husband; otherwise your children should be unclean; but now they are holy." Unfortunately for the strength of this argument, the context shows that the Apostle in this passage is not treating of regenerating or sanctifying grace at all, but answering certain questions proposed to him by the Corinthians concerning the validity of marriages between heathens and believers. The validity of such marriages is proved from the fact that children born of them are legitimate, not spurious. As far as the term "sanctified" is concerned, it can, at most, mean that the believing husband or wife may convert the unbelieving party and thus become an occasion of their sanctification. A certain statement in the funeral oration of St. Ambrose over the Emperor Valentinian II has been brought forward as a proof that the Church offered sacrifices and prayers for catechumens who died before baptism. There is not a vestige of such a custom to be found anywhere. St. Ambrose may have done so for the soul of the catechumen Valentinian, but this would be a solitary instance, and it was done apparently because he believed that the emperor had had the baptism of desire. The practice of the Church is more correctly shown in the canon (xvii) of the Second Council of Braga: "Neither the commemoration of Sacrifice [oblationis] nor the service of chanting [psallendi] is to be employed for catechumens who have died without the redemption of baptism." The arguments for a contrary usage sought in the Second Council of Arles (c. xii) and the Fourth Council of Carthage (c. Ixxix) are not to the point, for these councils speak, not of catechumens, but of penitents who had died suddenly before their expiation was completed. It is true that some Catholic writers (as Cajetan, Durandus, Biel, Gerson, Toletus, Klee) have held that infants may be saved by an act of desire on the part of their parents, which is applied to them by some external sign, such as prayer or the invocation of the Holy Trinity; but Pius V, by expunging this opinion, as expressed by Cajetan, from that author's commentary on St. Thomas, manifested his judgment that such a theory was not agreeable to the Church's belief.
sorry for the long read