Baptism was instituted as a sign that an individual belongs to the church and as a reminder that she or he needs to be regenerated. The washing of baptism is actually the spiritual washing that is regeneration.
All our regeneration is carried out by the Lord, by means of truths that belong to religious faith and by a life in accord with those truths. This means that baptism is a witness that an individual belongs to the church and is capable of being regenerated, because it is in the church that the Lord, who regenerates us, is acknowledged; and it is there that we find the Word, which contains the truths of religious faith that are required for our regeneration.
The Lord teaches us this in John: “Unless you have been born of water and the spirit you cannot enter the kingdom of God” (John 3:5). “Water,” spiritually understood, is truth for our faith that is drawn from the Word, “the spirit” is a life in accord with that truth, and “being born” is being regenerated as a result of both.
Since everyone who is being regenerated also undergoes crises of the spirit, which are spiritual battles against evil and falsity, the waters of baptism also mean spiritual crises.
Since baptism serves as a sign and a reminder of all this, we can be baptized as infants or, if not then, as adults.
People who have been baptized should be aware that baptism itself does not give them either faith or salvation but it does bear witness that they will receive faith and be saved if they are regenerated.
We can therefore conclude what is meant by the Lord’s words in Mark: “Those who believe and are baptized will be saved; but those who do not believe will be condemned” (Mark 16:16). The one who believes is the one who acknowledges the Lord and accepts divine truths from him through the Word; and the one who is baptized is the one whom the Lord regenerates by these means.
from New Jerusalem, Sections 202-208