God tells Moses to turn back and camp by the sea — between Pi-hahiroth and the sea — in a position that will appear to Egypt as though Israel is wandering confused and trapped by the wilderness. God will harden Pharaoh's heart one final time, and Pharaoh will pursue.
Pharaoh is told that Israel has fled. His heart — and the hearts of his servants — changes. What have we done, that we have let Israel go from serving us? He takes his chariot and his people with him, six hundred chosen chariots plus all the chariots of Egypt, and pursues.
Israel, camped by the sea, sees the Egyptian army approaching — horses, chariots, army. They are terrified. They cry out to God. And then they turn on Moses: Was there no graves in Egypt? You brought us here to die in the wilderness. This is what we told you in Egypt — let us alone and serve the Egyptians. Better to serve them than to die here.
Moses answers: do not be afraid. Stand still, and see the salvation of God which he will show you today. The Egyptians you see today you will see no more forever. God will fight for you. You only need to be still.