The story of Shabbat starts at the very beginning of everything. It comes from the first creation story in Chapters 1-2 of the book of Genesis, at the very beginning of the Torah, the Jewish scriptures.
Read the story here.
In the story God took six days to create the universe, and on the seventh day he rested.
“God blessed the seventh day and made it holy, because on that day he ceased from all the work he had set himself to do.”
Day 1 Day 2