"And the LORD said to Moses, Stretch out your hand over the sea" (Exodus 14:26). The sea will not stand against you. "And the waters shall return upon Egypt" (Exodus 14:26) - let the wheel turn back upon them and their wickedness return upon them, for by the very scheme by which Egypt thought to destroy Israel, by it I destroy them. They thought to destroy My children by water; I too will exact punishment from them only by water. "He dug a pit and hollowed it out... his mischief shall return upon his own head" (Psalms 7:16-17), and it says, "He who digs a pit shall fall into it" (Proverbs 26:27); and it says, "He who digs a pit shall fall into it, and whoever quarries stones shall be hurt by them" (Ecclesiastes 10:8-9). And so Solomon says, "From the fruit of a man's mouth he shall be satisfied with good" (Proverbs 12:14). And so Isaiah said, "According to their deeds, accordingly will He repay" (Isaiah 59:18), and it says, "And I will measure their former work" (Isaiah 65:7). And so Jeremiah said, "Great in counsel and mighty in deed" (Jeremiah 32:19), and it says, "Repay her according to her work" (Jeremiah 50:29). And so Jethro said to Moses, "Now I know that the LORD is greater than all gods, for in the very thing in which they acted presumptuously" (Exodus 18:11) - I knew Him before, and now all the more, for His name is magnified in the world, that by the very scheme by which Egypt thought to destroy Israel, by that thing the Holy One, blessed be He, exacted punishment from them, as it is said, "for in the thing in which they acted presumptuously against them" (Exodus 18:11). "And the sea returned at the turning of the morning to its strength [le-eitano]" (Exodus 14:27). Rabbi Yochanan said: the Holy One, blessed be He, made a condition [tenai] with the sea that it should be split before Israel. This is what is written, "And the sea returned at the turning of the morning to its strength" - to its condition [li-tenao] that the Holy One, blessed be He, made with it. And it is written, "Let the waters be gathered" (Genesis 1:9) - let the waters wait [yekavvu] for Me, for what I am destined to do with them.
The Sea Returned to the Covenant Made at Creation
Yalkut Shimoni on Torah 236:1
(שמות יד כו) וַיֹּאמֶר ה' אֶל מֹשֶׁה נְטֵה אֶת יָדְךָ עַל הַיָּם. אֵין הַיָּם עוֹמֵד כְּנֶגְדֶּךָ. וְיָּשֻׁבוּ עַל מִצְרַיִם, וְיַחֲזֹר עֲלֵיהֶם הַגַּלְגַּל וְיַחֲזֹר עֲלֵיהֶן זְדוֹנָם, שֶׁבַּמַּחֲשָׁבָה שֶׁחָשְׁבוּ מִצְרַיִם לְאַבֵּד אֶת יִשְׂרָאֵל בָּהּ אֲנִי מְאַבְּדָן. הֵם חָשְׁבוּ לְאַבֵּד אֶת בָּנַי בַּמַּיִם, אַף אֲנִי לֹא אֶפָּרַע מֵהֶן אֶלָּא בַּמַּיִם. (תהלים ז, טז יז) "בּוֹר כָּרָה וַיַּחְפֵּרֵהוּ וְגוֹ' יָשֻׁב עֲמָלוֹ בְרֹאשׁוֹ" וְגוֹ', וְאוֹמֵר "כֹּרֶה שַּׁחַת בָּהּ יִפֹּל". וְאוֹמֵר (קהלת י, ח ט) "חֹפֵר גּוּמָּץ בּוֹ יִפּוֹל מַסִּיעַ אֲבָנִים יֵעָצֵב בָּהֶם". וְכֵן שְׁלֹמֹה אוֹמֵר (משלי יב, יד) "מִפְּרִי פִי אִישׁ יִשְׂבַּע (נַפְשׁוֹ) [טוֹב"]. וְכֵן יְשַׁעְיָה אָמַר "כְּעַל גְּמֻלוֹת כְּעַל יְשַׁלֵּם", וְאוֹמֵר (שם סה, ז) "וּמַדֹּתִי פְעֻלָּתָם רִאשֹׁנָה". וְכֵן יִרְמִיָּה אָמַר (ירמיה לב, יט) "גְּדֹל הָעֵצָה וְרַב הָעֲלִילִיָּה", וְאוֹמֵר (שם נ, כט) "שַׁלְּמוּ לָהּ כְּפָעֳלָהּ". וְכֵן אָמַר יִתְרוֹ לְמֹשֶׁה "עַתָּה יָדַעְתִּי כִּי גָדוֹל ה' מִכָּל הָאֱלֹהִים כִּי בַדָּבָר אֲשֶׁר זָדוּ", מַכִּירוֹ הָיִיתִי לְשֶׁעָבַר וְעַכְשָׁיו בְּיוֹתֵר שֶׁנִּגְדַּל שְׁמוֹ בָּעוֹלָם, שֶׁבַּמַּחֲשָׁבָה שֶׁחָשְׁבוּ מִצְרַיִם לְאַבֵּד אֶת יִשְׂרָאֵל בּוֹ בַּדָּבָר נִפְרַע מֵהֶם הַקָּדוֹשׁ בָּרוּךְ הוּא, שֶׁנֶּאֱמַר (שם) "כִּי בַדָּבָר אֲשֵׁר זָדוּ עֲלֵיהֶם". (שמות יד כז) וַיָּשָׁב הַיָּם לִפְנוֹת בֹּקֶר לְאֵיתָנוֹ. אָמַר רַבִּי יוֹחָנָן, הִתְנָה הַקָּדוֹשׁ בָּרוּךְ הוּא תְּנָאִים עִם הַיָּם שֶׁיְהֵא נִקְרָע לִפְנֵי יִשְׂרָאֵל, הָדָא הוּא דִּכְתִיב, וַיָּשָׁב הַיָּם לִפְנוֹת בֹּקֶר לְאֵיתָנוֹ, לִתְנָאוֹ שֶׁהִתְנָה הַקָּדוֹשׁ בָּרוּךְ הוּא עִמּוֹ, וּכְתִיב "יִקָּווּ הַמַּיִם", יְקַוּוּ לִי הַמַּיִם מַה שֶּׁאֲנִי עָתִיד לַעֲשׂוֹת בָּהֶם.