The aseret hadibrot present two very different reasons why we are to keep Shabbat. In parshat Yitro, it is “because in six days, G-d made the heaven and the earth, the sea and all that is in it; and He rested on the seventh day” (Shemot 20:11). Forty years later, when Moshe recounts them to the children of those who were at Sinai, we keep Shabbat so that “you shall remember that you were slaves in the land of Egypt, and G-d took you out from there with a strong hand and an outstretched arm” (Devarim 5:15).
The Jew leaving Egypt needed no reminder of his days in slavery. The generation that left Egypt was surrounded by a culture of idolatry, where a Pharaoh could ask, “Who is G-d?” Egyptian and Jew alike had to be shown, time and time again, that there is one G-d Who runs the world. Shabbat was to be the weekly reminder of G-d, the Creator of heaven and earth.
Their children faced different challenges. Having been brought up in the aftermath of Sinai, they lived miraculously in the desert for 40 years—getting water from a rock and food from the sky, with clothes that remained fresh and shoes that did not wear out. They knew quite well that G-d was Master of the Universe. But because they did not suffer slavery in Egypt, they needed a reminder of the slavery of their ancestors. They—who had time galore, wandering aimlessly for days and years on end—needed to appreciate the gift of freedom, and to be willing to fight for it. They had to internalize how the distinguishing feature between freedom and slavery is that of time: the free person controls it, whereas the slave is controlled by it.
The Torah, in the second set of luchot, adds an additional factor: “so that your slave and maidservant can rest like you”. We may keep Shabbat because we were once slaves; but that must serve as an impetus to ensure that we do not enslave others. Shabbat is not just a day of rest, but a day for Jews to grant rest to others.
We keep Shabbat both as a mitzvah between man and G-d, and a mitzvah between man and man. It teaches the most fundamental principles about G-d, and the most basic requirement of man.
The generation that left Egypt that was to focus on the man-to-G-d aspect of Shabbat, while those who were about to enter the Land of Israel were to focus on man-to-man aspect. In exile, we must focus on our relationship with G-d, otherwise we risk assimilation into the dominant culture.
For the generation that was to enter the Land of Israel—the Land where the presence of G-d is felt in the air—it was the interpersonal aspect of Shabbat that was to be the focus. The process of nation-building requires social cohesion. Society can exist despite the most aberrant religious beliefs (see Meshech Chochmah 14:24)—but absent social cohesion and a sense of shared community, society cannot endure.
The mitzvot of the Torah have multiple reasons and goals. Which goal is paramount depends on the situation in which one finds oneself. Applying the right goal to the right situation is what makes the Torah a Torat chaim, a living Torah.