There are two main reasons given in the Old Testament as to why the Israelites are to observe the Sabbath. The first one is mentioned in Exodus 31:16-17 [KJV]:
16 Wherefore the children of Israel shall keep the sabbath, to observe the sabbath throughout their generations, for a perpetual covenant.
17 It is a sign between me and the children of Israel for ever: for in six days the LORD made heaven and earth, and on the seventh day he rested, and was refreshed.
From these verses it seems like the motive behind the Sabbath is to commemorate the creation (though I'm not quite sure what is the significance of such a commemoration).
In Exodus 20:10-11 the same reason is stated, but the emphasis is on the fact that God rested and not so much on the creation aspect, and the word "sign" is entirely omitted:
10 But the seventh day is the sabbath of the LORD thy God: in it thou shalt not do any work, thou, nor thy son, nor thy daughter, thy manservant, nor thy maidservant, nor thy cattle, nor thy stranger that is within thy gates:
11 For in six days the LORD made heaven and earth, the sea, and all that in them is, and rested the seventh day: wherefore the LORD blessed the sabbath day, and hallowed it.
From here it would seems like the purpose of the Sabbath observance is to emulate God's activity during the week and on the Sabbath when he rested.
The second reason is stated in Deuteronomy 5:14-15:
14 But the seventh day is the sabbath of the LORD thy God: in it thou shalt not do any work, thou, nor thy son, nor thy daughter, nor thy manservant, nor thy maidservant, nor thine ox, nor thine ass, nor any of thy cattle, nor thy stranger that is within thy gates; that thy manservant and thy maidservant may rest as well as thou.
15 And remember that thou wast a servant in the land of Egypt, and that the LORD thy God brought thee out thence through a mighty hand and by a stretched out arm: therefore the Lord thy God commanded thee to keep the sabbath day.
Over here nothing about creation or God's actions are mentioned, the only reason given, is that God took you out of Egypt, that is why the Israelites must keep the Sabbath (perhaps this may serve as a reminder that they were once slaves in Egypt where they had no rest, similar to the observance of the Passover. Perhaps the idea is to encourage them to relieve their slaves from bondage temporarily).
Summary: two main reasons are stated in the Old Testament.
- To commemorate the creation, or to emulate God's actions during creation.
- To commemorate the exodus.
If it is possible to reconstruct I would like to know which of the reasons - cited above - was the original motive behind the Sabbath, and which were only added later? Secondly, what is the significance of commemorating the creation (mentioned in Exodus 31, cited above) and why is it so important?