Why Shemot 20:11 refers to Bereshit's history of six days earth creation and Devarim 5:15 doesn't refer to it? In Shemot it refers to Bereshit's history of six days of creation,and in Devarim 5:15 it is not mentioned. Why there is a difference, given that both texts where taken from the same tables?
This is a great question that all the commentators deal with directly or indirectly. A related question is what is meant when the verse in Devarim says,
שָׁמ֛֣וֹר אֶת־י֥וֹם֩ הַשַּׁבָּ֖֨ת לְקַדְּשׁ֑֜וֹ כַּאֲשֶׁ֥ר צִוְּךָ֖֣ ׀ יְהֹוָ֥֣ה אֱלֹהֶֽ֗יךָ׃
Observe the sabbath day and keep it holy, as the LORD your God has commanded you.
The Ibn Ezra interprets this phrase to be referring back to the original commandment in Shemos. So the Torah says, "Keep the Shabbos as I commanded you already", and the reason would be because of the six days of Creation and G-d resting on the seventh, as it says there. The Exodus from Egypt is only mentioned to explain why one's servants also have to rest.
This explanation does not work in Rashi, who understands that phrase to be referring to the commandments the Jews received at Marah before the revelation at Sinai. Rashi does not address your question directly, but he comments on the verse in Devarim saying:
וזכרת כי עבד היית וגו'. עַל מְנָת כֵּן פְּדָאֲךָ שֶׁתִּהְיֶה לוֹ עֶבֶד וְתִשְׁמֹר מִצְווֹתָיו:
On this condition you were redeemed, that you would be a servant to him and keep his commandments.
This comment is explained by the Sifsei Chachamim as being related to the prohibition for labor:
He freed you on the condition, etc. Because Hashem knows that it is difficult for them to abstain from work. We find this regarding Purim, that they accepted upon themselves a day of drinking and rejoicing, but not for [abstaining from] work (Maseches Megillah 5b). Therefore, he mentions to them that they were slaves. That is to say, when a master tells his slave to abstain from work, it is only right that the slave obeys him because the work [he does] is only for his master. Otherwise, why is slavery mentioned here? [Maharai].
So in Shemos, where it discusses the concept of זכור/zachor remembering the concept of Shabbos and keeping its positive commandments, the Torah gives the basic reason of Shabbos, which is to remember the seven days of Creation. In Devarim, where the Torah discusses שמור/shamor, keeping the negative commandments, the Torah mentions the Exodus from Egypt to explain why one must observe the prohibitions against doing labor despite the difficulty involved.
The Ramban adds another factor, which is that in Kiddush we say that Shabbos is זכר ליציאת מצרים, a remembrance to the Exodus from Egypt. This indicates that Yetzias Mitzrayim is more fundamental to Shabbos. He quotes the Rambam in Moreh Nevuchim who says that there are basically two purposes to the Shabbos: First, to remember and honor that day, as it says in Devarim; second, to rest on the Sabbath in contrast to the slavery in Egypt when Jews could not rest from their labors. [As with Rashi, the first reason fits better with zachor, the second with shamor.] This approach is also endorsed by Abarbanel and Bechor Shor.
The Ramban argues on the Rambam because he feels that just not doing melacha is not an adequate way to remember the Exodus from Egypt. Instead, he resolves the contradiction by means of his oft-stated principle that the Exodus from Egypt demonstrated that G-d created and completely controls the world. Thus, focusing on the Exodus (per Devarim) reinforces the reason of remembering that G-d created the world (as per Shemos).
Read the context carefully between the two Ten Commandments texts.
God rested on the seventh day, *therefore* He blessed the seventh day.
(Why is the seventh day special? Because of creation.)
(Okay but why should the Jews specifically keep the Sabbath?)
Remember you were slaves in Egypt, *therefore* God commanded you to keep the Sabbath.