The Moabites were a people to the southeast of Judah who were historical enemies of Israel (see Numbers 25:1–18; Psalm 106:28; Hosea 9:10; Deuteronomy 23:3–6; Judges 3:12–30).1 David had previously sought shelter for his parents from the Moabites when he was being pursued by Saul (1 Samuel 22:3–4). According to a Jewish tradition, the king of Moab betrayed David’s trust and murdered his parents.2 Whilst this cannot be verified, we must assume that something happened to sour relations and result in war.
2 And he defeated Moab and he measured them with a line, making them lie down on the ground. Two lines he measured to be put to death, and one full line to be spared. And the Moabites became servants to David and brought tribute.