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.
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.