In addition to the miracle of the flood, one of the greatest miracles of the Old Testament was a forerunner and type of what true baptism pictures today. It was the Israelites' crossing of the Red Sea. When the Israelites fled Egypt and Pharaoh's army pursued them, Moses led the people through walls of water, mounting waves held back supernaturally.
Israel was "baptized" (or, as the word in the original Greek means, "immersed" or "plunged into") in the cloud and in the sea. The apostle Paul refers to this in:
Symbolically, the Israelites left their old lives in Egypt by going into what normally would have been a "watery grave." Anyone else on earth other than the Israelites would have been destroyed or killed in the waters of the Red Sea, as the Egyptians were.
In I Corinthians 10:11, God reveals that these Old Testament events occurred to be examples to Christians.
Israel had just come out of captivity in Egypt. God said that He was going to bring them up out of the land of oppression—that pagan land of strange customs and evil ways. So God sent Moses to deliver them from their bondage in the land of sin. Israel was in sin, living the wrong way. And God set His hand to deliver them.
After Israel's exodus from Egypt, God brought them to encamp beside Pi Hahiroth, before Baal Zephon. To Israel's amazement they found themselves trapped, with Egyptians closing in on them. The only way of escape was through the Red Sea.
When Israel saw Pharaoh's army pursuing them, they became filled with fear. However, Moses assured them of God's deliverance.
This type of "immersion" was a veritable grave for anyone who was not an Israelite at that time, and Pharaoh and his men all perished in it. Pharaoh was still in sin and therefore was doomed.
Israel went through the Red Sea, picturing the death of that former way of life—then, coming up out of the grave by God's grace, they were to enter a new way of life, a promised land.
And so in the New Testament God requires Christians to crucify the old man, the former way, and to come up out of a watery grave into a better way of life. We are to walk in newness of life. The Israelites were a type of that when they came through the Red Sea. After being baptized they came into a newness of life.
Israel's baptism was only a type. That baptism was under the Old Covenant, a physical agreement with physical ordinances and material rewards. But notice what God says about the New Testament Covenant.