As long as the child does not have the use of reason, he is no different than an irrational animal, and so he must be under the care of his parents. After he begins to have the use of free will, he begins to become his own and can provide for himself with respect to matters of divine and natural law. At that point, the free adult may be drawn to the faith by persuasion, but not compelled. We must consider also that baptism is a sacrament that is administered in a very short time. However, what Thomas says about baptism concerns not only the baptism itself, but all that it entails.
Baptism entails a relgious upbringing, especially catechetical learning.
The arguments in this case can easily be applied to any cases of compulsory education. The parents have primary rights in deciding what is best for their children. Thomas defends the view that one man may truly teach another. Thomas brings forth biblical passages where the apostlesf call themselves teachers. While God is the source of all truth, and so the ultimate teacher, this does not prevent him from using other creatures as instruments by which He teaches men.