Deuteronomy 6: 1 “Now this is the commandment, the statutes, and the judgments which the Lord your God has commanded me to teach you, so that you may do them in the land where you are going over to take possession of it, 2 so that you, your son, and your grandson will fear the Lord your God, to keep all His statutes and His commandments which I command you, all the days of your life, and that your days may be prolonged. 3 Now Israel, you shall listen and be careful to do them, so that it may go well for you and that you may increase greatly, just as the Lord, the God of your fathers, has promised you, in a land flowing with milk and honey.
4 “Hear, Israel! The Lord is our God, the Lord is one! 5 And you shall love the Lord your God with all your heart and with all your soul and with all your strength. 6 These words, which I am commanding you today, shall be on your heart. 7 And you shall repeat them diligently to your sons and speak of them when you sit in your house, when you walk on the road, when you lie down, and when you get up. 8 You shall also tie them as a sign to your hand, and they shall be as frontlets on your forehead. 9 You shall also write them on the doorposts of your house and on your gates.
10 “Then it shall come about when the Lord your God brings you into the land that He swore to your fathers, to Abraham, Isaac, and Jacob, to give you, great and splendid cities which you did not build, 11 and houses full of all good things which you did not fill, and carved cisterns which you did not carve out, vineyards and olive trees which you did not plant, and you eat and are satisfied, 12 be careful that you do not forget the Lord who brought you out of the land of Egypt, out of the house of slavery. 13 You shall fear only the Lord your God; and you shall worship Him and swear by His name. 14 You shall not follow other gods, any of the gods of the peoples who surround you, 15 for the Lord your God who is in the midst of you is a jealous God; so follow Him, or else the anger of the Lord your God will be kindled against you, and He will wipe you off the face of the earth.
The question to ask is, why would someone write this and in what context?
What possible purpose would an account like this have within a society that is peacefully living as subjects of a multi-ethic and religiously diverse empire?
Again, this strikes me as the type of narrative that would be created in an environment where the society is in disarray, there is a need to enforce conformity, there is a need to focus the actions and motivations of the community, there is a strong need for cohesion.
The stories of the Pentateuch are all about the development of cohesion and unity in the face of chaos, dismay and unsure times.
The overall message of the Pentateuch is: come together, obey, do what you're told, do not mix with other cultures, set yourself apart, be ready to fight, be prepared to fight against overwhelming odds, seize the land, take what is your God given destiny.
This in no way makes any sense in the context of a subject population peacefully living within a multi-ethnic empire.