וַיֵּצֵא קַיִן מִלִּפְנֵי ה' וַיֵּשֶׁב בְּאֶרֶץ נוֹד וגו' (ד, טז)
And Kayin left from before Hashem, and he dwelled in the land of wanderers. (4:16)
Shabbos Atones for all Sins:
The Medrash (Bereishis Rabbah 22:13) relates that Kayin met Odom Harishon, who asked him how his judgment went. Kayin said, “I did teshuva, and it was resolved.”
Odom then began to strike his own face, and he said, “Is that the power of teshuva?”
He then said, “Mizmor shir l’yom haShabbos…”
Sefer Tiferes Shmuel (Ois 5) explains the connection between teshuva and Shabbos by citing the Gemara (Shabbos 119B) that says: “Anyone who observes Shabbos according to halacha, even if he served idols like the generation of Enosh, he is forgiven.” The Taz (Siman 242) asks: If the person did teshuva, he would be forgiven in any case. If he did not do teshuva, why is he forgiven?
He answers that the zechus of keeping Shabbos atones even when teshuva is not enough. While it is true that teshuva atones for most sins, there are some severe transgressions that need a special form of teshuva. For such sins, even though regular teshuva usually would not be enough, if one has the merit of observing Shabbos, he is forgiven.
The reason behind this is that observing Shabbos is considered equivalent to keeping the entire Torah (Shemos Rabbah, Parshas Beshalach). Therefore, it can atone for all sins.
The reason that Shabbos is so powerful is because on Shabbos, one’s soul ascends to a place where there is no impurity and no damaging forces.
For this reason, the Arizal states that when one recites the words “v’asisem es kol mitzvosai” in Kriyas Shema, he should have in mind that he is accepting upon himself to observe Shabbos, as Shabbos is equal to all mitzvos and observing it allows one’s soul to connect to the Upper Realms.
We can now understand that when Kayin told Odom that he had done teshuva and been forgiven, Odom understood that it must be in the merit of Shabbos. He thus recognized the greatness of Shabbos and composed a song of praise about it.