God told Israel they would be blessed if they kept the Law of Moses.
GOD promised Israel through Moses that they would be blessed if they kept GOD’s laws:
12 “Then it shall come to pass, when you listen to all these ordinances and keep and do them, the Lord your God will keep with you the covenant and the mercy He swore to your fathers; 13 and He will love you and bless and multiply you; He will also bless the offspring of your womb, and the fruit of your land: your grain, wine, and olive oil, and the herds of your oxen, and the flocks of your sheep, in the land the Lord swore to your fathers to give you. 14 You shall be blessed more than all the nations; there shall not be a childless male or a barren female among you or your cattle. 15 And the Lord will take away from you all sickness, and He will not put on you the evil diseases you saw and knew in Egypt, but will put them on all who hate you. 16 Also you shall eat all the spoils of the nations the Lord your God gives you; your eye shall have no pity on them; nor shall you serve their gods, for that would be a snare to you.Deuteronomy 7:12-16 OSB
GOD’s immediate purpose for Israel was to displace the wicked Canaanites and enjoy the blessings of the land. However, this depended upon Israel’s faithfulness to GOD and His decrees.