The day of Shabbos is described in Kiddush as being a זכר ליציאת מצרים, a commemoration of the Exodus from Egypt, as well as a זכר למעשה בראשית, a commemoration of the creation of the world. On a simple level, the connection to מעשה בראשית is apparent; just as Hashem rested on the last day of His week of creation and thus gave that day a special holiness, we too rest at the end of our working week, and make our seventh day holy. We may suggest that the connection to יציאת מצרים is similar; just as the Jews were freed by Hashem of the burden of servitude to the Egyptians, and thus began preparations to receive the Torah, we too are freed once a week of the many demands placed on us, and are elevated to a new spiritual plateau. However, this is not the full explanation of these two statements.
To understand the two completely, it is helpful to look at them not as two separate equations of Shabbos to two separate events, but rather as a three-way equation of מעשה בראשית equals Shabbos equals יציאת מצרים, in which it is implicit that there is some connection between the creation of the world and the Exodus from Egypt.
On the second day of creation, the Torah describes the establishment of a רקיע בתוך המים, a void in the middle of the waters which had previously occupied the entire world (בראשית א':ו'.) Hashem now suspended some of the water in heaven and forced the rest of it down, making room for human life in the middle. However, when Hashem determined that the world had deteriorated excessively, He allowed the two bodies of water to come crashing back together and destroy all that existed between them, as the Pasuk in Parshas Noach descibes, "נבקעו כל מעינות תהום רבה וארובות השמים נפתחו"- the wells of below burst forth and the windows of the heavens were opened.(שם ז:י"א) The only individuals who managed to weather this storm were Noach and his family.
Looking at the Torah's account of קריעת ים סוף, the splitting of the Red Sea, which is described in this week's Parsha, we see a very similar image. The waters which had impeded the Jews' progress were forced to split into two bodies, with empty space in the middle, as the Torah describes, "והמים להם חומה מימינם ומשמאלם" )שמות
י"ד:כ"ב(, the waters stood in two "walls", one to the right of the Jews, and one to their left. As soon as the Egyptians entered this space, Hashem removed the invisible forces restraining the waters, and they thundered back down with full force, drowning the entire Egyptian army (שם פסוק כ"ח). Only the Jews emerged safely on the opposite bank.
We can now see a pattern which both יציאת מצרים and מעשה בראשית follow. In both instances, water was parted to allow righteous people to exist in the middle. In both, when wicked people attempted to capitalize on this occurence, the phenomenon suddenly ended and they were drowned from both sides. Essentially, in both episodes, Hashem demonstrated the two faces of his power of הבדלה, separation. He showed that in the mundane, physical realm He was the master of יצירה, the ordering of the universe, and that He could arrange matter in any way which he saw fit, even when dealing with water, a substance which is ordinarily very difficult to manipulate. After making this clear, He demonstrated that He also had the ability to differentiate between people who were deserving of special assistance and people who were not. Finally, in both cases, the people who emerged safely took on great stature, as the recipients of the Torah and the founders of human society. This process of יצירה followed by הבדלה בין קודש לחול is certainly one theme which is common to Maasei Bereishis, the Exodus from Egypt, and Shabbos.
Shabbos is our recognition of Hashem's power as the ultimate מבדיל, as well as Hashem's recognition that we are the people whom He considers קודש. Hashem sanctifies the Jews by giving Shabbos exclusively to them, and we in turn trust Him, by making this day sacred and separate from the rest of the week. In this way, it serves as the sign of the agreement between Hashem and the Jews, as the Torah tells us, ביני ובין בני ישראל אות היא לעולם, it is a sign between Me and the Jews forever )שם ל"א:י"ז(. Just as the rainbow which Hashem showed to Noach serves as an eternal sign between Hashem and humanity that He will allow them to continue to exist physically, Shabbos serves as an eternal sign between Hashem and the Jews that he will allow us to exist spiritually.