Before examining the differences in the two versions of the Decalogue, we need to discuss the general relationship between the two versions of the Decalogue. One possibility is that in Devarim, Moshe was repeating the exact words said by G-d at Mount Sinai by the first Decalogue. This would seem to be Rashi's approach. He explains that Devarim 5:11 records that one is to observe the Shabbat, while Shemot 20:8 records that one is to remember the Shabbat since the words "observe" and "remember" were both said simultaneously at Mount Sinai. The same idea is also implicit in Rashi's comments with regard to Devarim 5:11,15, which record the commandment to keep the Shabbat and to honor one's parents. These verses record that in Devarim, Moshe told the people that they are to follow the laws "as commanded by G-d." If this phrase was said on Mount Sinai, then what can be the reference to the word "commanded" (in the past) since when were the laws commanded before Mount Sinai? Rashi explains that the laws of Shabbat and honoring one's parents were told to the people at Mara before the Decalogue. Thus, during the Decalogue at Mount Sinai, God could have said the words "as commanded."
The second possibility to understanding the relationship between the two versions of the Decalogue is that in Devarim, Moshe was not trying to repeat the exact words of G-d at Mount Sinai but was trying to explain the Decalogue. According to this approach, Devarim 5:19 means that G-d spoke these ideas but not these exact words. This is the approach of Ibn Ezra (on 5:5), Rashbam (on 5:11), Hizkuni (on 5:18) and Or ha-Chayyim (on 5:19). One proof for the second approach is that if both observe and remember were said by G-d in reference to the Shabbat, then why were they not included in both versions of the Decalogue? With the second approach, one can understand why the second version of the Decalogue is not exactly the same as the first version since Moshe made changes, but then the question is why would Moshe make changes to the Decalogue? We will follow this second approach, and try to explain the differences.
The first difference between the two versions of the Decalogue with regard to the Shabbat was already mentioned, that in Shemot 20:8, the wording is that one is to remember, zachor, the Shabbat, while Devarim 5:11 records that one is to observe, shamor, the Shabbat. As mentioned above, one answer is that really both words were said by G-d simultaneously at Mount Sinai. Ibn Ezra in his introduction to the Decalogue of Shemot asks numerous questions on this idea. Why were both words not recorded in both Shemot 20 and Devarim 5? Why would G-d speak simultaneously? Why did the Torah not record this great miracle of speech and hearing?
Ibn Ezra (on Shemot 20:1, also see comments on Devarim 5:5) argues that the word remember, zachor includes the idea of observe, shamor, that one remembers the Shabbat each day in order to protect one from doing work on the Shabbat. He claims that when the people heard the word remember, zachor, they understood that it meant the same as observe, shamor, which is like they were said simultaneously. The idea is that the words, zachor and shamor, have similar meanings even though we translate them differently. In fact, as pointed out by Hizkuni (on 5:11) from Bereshit 37:11 we see that the two words have the same meaning in the Torah. Bereshit 37:11 records that Yaakov shamor the dreams of Yosef, and the meaning is that Yaakov remembered the dreams of Yosef. Luzzatto (on 5:12) adds that the word shamor in 16:1 also has the connotation of remember the month of Aviv. (See also Rashi on Devarim 12:28.)
Yet, even if the words shamor and zachor are synonyms, still why did Moshe switch from zachor to shamor? A possible answer is that in the Decalogue of Devarim, Moshe not only refers to the Decalogue at Mount Sinai, but also to other references to the Shabbat in the Torah. Thus, by using the word shamor, Moshe was also incorporating the discussion of the Shabbat in Shemot 31:12-17, where the word shamor figures prominently (31:13,14,16).
The second difference between the two versions of the Decalogue with regard to the Shabbat is that as mentioned above, Devarim 5:11 records the word that "G-d commanded you" but these words were not mentioned in the first version of the Decalogue. Rashbam (on 5:11, also see Ibn Ezra on 5:5) explains that in Devarim, Moshe was referring to the first Decalogue. Moshe was saying observe the Shabbat as G-d had commanded you by the first Decalogue. This phrase "commanded" also occurs by the commandment to honor one's parents. Rashbam (on 5:11, Torah Chayyim version) notes that the sayings by the Shabbat and honoring one' parents are the only positive commandments in the Decalogue, and hence only by these commandments was it appropriate for Moshe to refer back to the first Decalogue by saying as you were commanded.
The third difference between the two versions of the Decalogue with regard to the Shabbat is that Shemot 20:9 records that "you, your children, your slaves, your animals and the stranger" are to rest on the Shabbat, while Devarim 5:13 adds "the cattle and the donkey and all your animals" to the list. Moshe made these additions since he was incorporating Shemot 23:12, which specifies that these animals are to rest on the Shabbat, within the laws of Shabbat of the Decalogue. Again, in the Decalogue of Devarim, Moshe not only refers to the Decalogue at Mount Sinai, but also to other references to the Shabbat in the Torah.
The last difference between the two versions of the Decalogue with regard to the Shabbat is the rationale for the Shabbat. Shemot 20:11 explains that the reason for the Shabbat is that G-d created the world and rested on the seventh day of creation. On the other hand, Devarim 5:13,14 record that the Shabbat is in order that your slaves will rest since one should remember the slavery in Egypt and that G-d redeemed us. This double rationale has led many (for example, Rambam, Moreh 2:31, also in Kiddush) to postulate that there are two reasons for the Shabbat, to remember creation and to remember the Exodus from Egypt.
Ramban (on 5:13) rejects this idea. He questions how resting on Shabbat can lead one to remember the Exodus from Egypt. He claims that really there is only one rationale for the Shabbat, the creation of the world, and the reference to the Exodus is only to help one believe in the creation of the world. He explains that if one has a difficulty in believing that G-d created the world, then he can learn from the Exodus that G-d intervenes in the world.
Ibn Ezra (on 5:5) seems to agree that the reason for Shabbat is the creation of the world, but suggests a different reason for the reference to the Exodus in Devarim. Ibn Ezra argues that the reference to the Exodus is a motive statement for why one should let one's slave rest on Shabbat. This is similar to Devarim 15:15, 24:18, and 24:22, that in each case the law is related to the Exodus but the Exodus is not the reason for the law, but a reason why one should obey the law. The idea is that not all rationales of the laws are sufficient to motivate a person to follow the law. Sometimes a secondary reason is needed for why one should follow the law independent of the true reason of the law. In this case, Shabbat is due to the fact that G-d rested as part of the creation of the earth. However, people might still be tempted to have their slaves do work for them on Shabbat, and thus Moshe reminds them that their slaves must rest because they should remember that they were also once slaves. (Note, this fear of forgetting that the people were once slaves was presumably greater with the second generation who did not grow up as slaves than the first generation who had vivid memories of slavery.)
Finally, another possibility is again that Moshe was combining the Decalogue in Shemot with the laws of Shabbat in Shemot 23:12, which state that the purpose of Shabbat was that one's animals and slaves would rest. This would be a second and possibly secondary reason for Shabbat (see Shemot 31:17), and once this idea of rest was mentioned then Moshe added the motive sentence of remembering that you were once slaves (5:14) as explained by the Ibn Ezra.
Another difference between the Decalogues is that by the fifth saying, Devarim 5:16 has the words "that it may go well with you," and these words were not included in the Decalogue in Shemot. These two phrases also appear together in Devarim 22:7, and I think the idea in both cases is to clarify the blessing of long live, that a person will have a healthy long life and not a long life filled with sickness and frailty. Note, probably the blessing of long life with regard to the fulfillment of this saying was only for this generation who lived in the desert, and then Moshe was explaining to the people that they would be granted healthy long lives and not that they would live longer but be sick.
Another difference between the Decalogue as recalled by Moshe in Devarim and what is recorded in Shemot is that in Shemot, none of the sayings begin with the word "and" while in Devarim, the seventh through tenth sayings being with the word "and," "and you are not to commit adultery, "and you are not to steal"….
Possibly, this difference is due to the difference between speech and the remembrance of past speech. The Decalogue as recorded in Shemot was a record of how G-d spoke to the people, and G-d would have spoken without using the word and, do not commit adultery, do not steal. The idea being that G-d probably paused between each of the sayings, as this is more dramatic, and then each saying would stand by itself with there being no need for the word and. However, in Devarim, when Moshe was recalling the Decalogue, he was not recreating the drama of the Decalogue, and he would have spoken without pausing, which meant using the word and to connect the different sayings.
Another difference between the Decalogue in Shemot and Devarim is with regard to the ninth saying. Shemot 20:13 records, "You are not to be a lying witness" while in Devarim Moshe told the people, "you are not to be a vain witness, 5:17." Ibn Ezra (on 5:5) writes that one should not be bothered by the two different words, lying and vain, since they have the same meaning. Hoffmann (on 5:17) explains that a vain witness is where the witness testifies about a fact that he did not see, which means that he is similar to a false or lying witness.
I would add that maybe Moshe was incorporating the prohibition recorded in Shemot 23:1, "you are not to take up an empty rumor" (Fox translation, 1995, p. 383). If one testifies about something that one did not see and if one is not consciously lying, then one is testifying based on a rumor. Once this testimony is forbidden, then certainly lying is prohibited. Thus, maybe in Devarim Moshe used the word vain to refer to both the prohibition of a lying witness (Shemot 20:13) and of testifying based on rumors (Shemot 23:1). However, in the Decalogue in Shemot, G-d spoke to the people about moral principles and thus G-d said do not be a lying witness, knowing that the idea about a vain witness would later be told to the people.
Another difference between the Decalogue in Shemot and in Devarim is with regard to the tenth saying. Shemot 20:14 records that one should not covet your neighbor's house, and then it specifies that one should not covet, your neighbor's wife, servants, animals or anything that your neighbor possess. On the other hand, Devarim 5:18, records that one should not crave your neighbor's wife, and one should not covet your neighbor's house, field, servants, animals and anything your neighbor possess.
There are three differences between these verses. One, Devarim 5:18 refers to both craving, tit'avveh, and coveting, hamad, while Shemot 20:14 only uses the word coveting. Two, in Shemot 20:14, the term house is used first and the neighbor's wife is included within the second clause with all the particulars. However, in Devarim 5:18, the neighbor's wife is mentioned in the first clause separate from the other items, and the neighbor's house is mentioned in the second clause. Three, Devarim 5:18 refers to the neighbor's field, while this is absent in Shemot 20:14.
With regard to the first question, many commentators attempt to find differences between the two words, craving and coveting, which means Moshe was adding a new prohibition. I think it is preferable to follow Rashi (on 5:18) that the two words have the same meaning. With regard to the second question, Hizkuni (on 5:18) explains that in Shemot, G-d was following the practices of a wise person, who first acquires a home, then a wife and then servants. However, in Devarim, Moshe was following the order of what young men desire, first a wife, then a house and then servants. With regard to the third question, Hoffmann (on 5:18) explains that fields were mentioned because the people were about to enter the land of Israel, but I doubt this since in Shemot, the people also thought they were about to enter the land of Israel.
My guess is that in Shemot the reference to a neighbor's house means household, which includes both the neighbor's wife and his possessions (see Tigay, 1996, p. 72). Thus, in Shemot, the Torah was first stating the general prohibition and afterwards the particulars. However, in Devarim, Moshe was again incorporating events that happened after the Decalogue when he was recalling the Decalogue. In the desert, the people had committed a sin of wrongful desiring, when they desired meat and other of foods from Egypt, and Bemidbar 11:33 records that the place where this sin occurred was called Kivrot Ha-taava, see also Bemidbar 11:4. This name refers to the word craving, tit'avveh, used by Moshe when recalling the Decalogue. Maybe, Moshe changed the word from covet to crave, to remind the people of their sin of wrongful desiring in Kivrot Ha-taava. Once Moshe made this change, then he had to remove the wife from the particulars, since the sin at Kivrot Ha-taava did not involve sexual desires. Thus, Moshe stated do not covet with regard to another man's wife, as recorded in Shemot, but when he wanted to recall prohibited desire for a neighbor's possessions, then he used the word crave, tit'avveh.
With regard to the third question, the inclusion of fields in the tenth prohibition, this also relates to a development in the Torah after the Decalogue, and depends on the definition of the prohibition of coveting, see our discussion on Shemot 20:14, "All in the mind?"
One possible definition is that the prohibition of coveting is when one desires an item that is not sold in the market. Based on this definition, maybe land was not included in the prohibition of coveting in Shemot 20:14 since in principle all land is subject to being sold. However, in Vayikra 25, the people were told that each family was to receive a plot of land which would remain with the family forever. This meant that land was no longer an item that could be permanently sold in the market, and then one could not covet land as recorded in Devarim 5:18.
A different possibility is based on the Rambam's (Laws of stealing and loss, 1:9) definition of coveting, that a person cannot pressure another person to sell something even if in the end the person agrees to the sale. With this idea, land was included in the prohibition in Shemot 20:14 that a person cannot pressure another person to sell land, but it was not specified. In Devarim 5:18, Moshe specified land since Vayikra 25:14-18 records the prohibition of ona'ah, which is taking advantage of a person's willingness to sell or buy land. If a person buys the land for less than the going price, then most likely, the buyer is pressuring the seller to sell as he/she knows that the seller is desperate to sell. Thus, Moshe added the reference to coveting lands since this could also include the prohibition of ona'ah.
Bibliography:
Fox, Everett, 1995, The Five Books of Moses: A new translation, New York: Schocken Books.
Tigay, Jeffrey H., 1978, 1996, The JPS Torah Commentary: Deuteronomy, Philadelphia: The Jewish Publication Society.