Baptism is Rooted in Jewish Law
Sooner or later, no matter how much care is taken to keep something clean, everything gets dirty. God provided a set of standards to demonstrate this principle. That set of standards, the Levitical Law, provides the instructions on how to recognize the dirt --uncleanliness-- and also the procedures for ceremonially cleaning them. The cleansings, or baptisms, were for everything from mildew on walls (Lev 14:33-53), to purification after child birth (Lev 12:1-8), to acceptance of a healed "leper" back into the community. (Lev 13:1-36, 14:1-32). So when the people saw John baptizing at the river Jordan, they thought that he was just following those traditions of cleansing.
...Jesus and his disciples went out into the Judean countryside, where he spent some time with them, and baptized. Now John also was baptizing at Aenon near Salim, because there was plenty of water, and people were constantly coming to be baptized. (This was before John was put in prison.) An argument developed between some of John's disciples and a certain Jew over the matter of ceremonial washing.
They came to John and said to him, 'Rabbi, that man who was with you on the other side the Jordan, the one you testified about-- well, he is baptizing, and everyone is going to him." To this John replied, "A man can receive only what is given him from heaven. You yourselves can testify that I said, 'I am not the Christ but am sent ahead of him.'" (John 3:22-28)
John quickly corrected the observers when they tried to compare what he was doing to a new and more popular event that was taking place nearby!
Jesus Used Washing Jars
Since these washings were so common, it shouldn't be surprising that Jesus performed His first miracle using some nearby ceremonial washing jars for containers to hold the wine that He converted from water.
Nearby stood six stone water jars, the kind used by the Jews for ceremonial washing, each holding from twenty to thirty gallons. Jesus said to the servants, "Fill the jars with water" ; so they filled them to the brim. Then he told them, " Now draw some out and take it to the master of the banquet." They did so, and the master of the banquet tasted the water that had been turned into wine. (John 2:6-9)
The laws regarding cleansings, along with all the other laws, were observed year after year because they couldn't really make a person clean --take away their sins. They were only shadows providing hints about how Christ was going to deal with our sins once and for all.
Note: Some have asked why there were six jars for cleansing. Six is the number for man. He was created on the sixth day; and the supreme man (totally fallen, totally corrupt) has the number 666. So the there are six jars to show that it was not the animals that crawled on the ground, fish that swam or birds that fly that needed to be cleansed. It's only man that is in need of purification. And why were they stone rather than clay? It's to demonstrate that the vessel was from God's creation. If it was mans' creation, it would have been made of clay. Our purification must come exclusively from God.
These are a shadow of the things that were to come; the reality, however, is found in Christ. (Colossians 2:17)
The Reality
The system of laws first showed how to recognize the various violations of purity. Then the priest examined the situation to confirm the presence of impurity and he provided instructions for cleansing. Later, after the physical cleansing was completed and after the impurity was eradicated, additional rituals were performed for ceremonial cleansing. When all of this was completed, the priest could finally declare that cleanliness had been re-established.
Through our "20/20 hindsight", the parallel becomes obvious. The law (whether written on stone for the Jews or on the heart for all), convicts man of his unrighteous, dead condition. He can then choose to go to the true Priest in order to be cleansed from all unrighteousness and gain eternal life. It's the same Priest who gave him the law, who examined him, who sprinkled him and who declared --and continues to declare-- him righteous.
A Curious Irony
Jesus began His ministry with a miracle --water which became wine. Remember the last supper when He explained that wine represented His blood? It's ironic that on the last day of His ministry, when He was pierced for our transgressions, out of His body (our cleansing jar) flowed those same two elements (blood followed by water). It started on a day celebrating the fulfillment of a wedding promise and now we look forward to our own wedding day --as His bride!