I understand that baptism saves us and washes away sin. But how does it do so?
Jesus spoke of baptism as a second birth (regeneration), saying, “Truly, truly, I say to you, unless one is born of water and the Spirit, he cannot enter the kingdom of God” (John 3:5). And St. Paul tells us that this new birth through baptism is salvific, stating that God “saved us, not because of deeds done by us in righteousness, but in virtue of his own mercy, by the washing of regeneration and renewal in the Holy Spirit” (Titus 3:5). And again in 1 Peter 3:21: “Baptism . . . now saves you, not as a removal of dirt from the body but as an appeal to God for a clear conscience, through the resurrection of Jesus Christ."
This washing of regeneration (re-birth) through the waters of baptism was instituted by Christ as an instrument of salvation. God also used water as the instrumental cause of salvation for the eight people aboard Noah’s ark (1 Peter 3:20-21).
St. Thomas Aquinas explains:
It was fitting that through the visible things themselves the remedies of salvation be applied to men.
Regarding the spiritual generation which takes place in baptism, one must consider that the generation of a living thing is a kind of change from non-living to life. But man in his origin was deprived of spiritual life by original sin and still every single sin whatever which is added draws him away from life. Baptism, therefore, which is spiritual generation, had to have the power to take away both original sin and all the actual, committed sins.
Now, because the sensible sign of a sacrament must be harmonious with the representation of its spiritual effect, and since washing away filth in bodily things is done more easily and more commonly by water, baptism is, therefore, suitably conferred in water made holy by the Word of God” (Saint Thomas Aquinas—On the Truth of the Catholic Faith Summa Contra Gentiles Book Four: Salvation p. 250).