וַיֹּ֨אמֶר יְהוָ֜ה אֵלַ֗י אֶל־תָּ֙צַר֙ אֶת־מוֹאָ֔ב וְאַל־תִּתְגָּ֥ר בָּ֖ם מִלְחָמָ֑ה כִּ֠י לֹֽא־אֶתֵּ֨ן לְךָ֤ מֵֽאַרְצוֹ֙ יְרֻשָּׁ֔ה כִּ֣י לִבְנֵי־ל֔וֹט נָתַ֥תִּי אֶת־עָ֖ר יְרֻשָּֽׁה׃
И сказал мне Господь: 'Не враждуй с Моавом и не сражайся с ними в битве; Я не отдам тебе земли его во владение; потому что я отдал Ар детям Лота во владение.—
Rashi
מאת המדינים [AVENGE THE CHILDREN OF ISRAEL] OF THE MIDIANITES — but not of the Moabites, for the Moabites entered into the matter out of fear, because they feared that they might plunder them, since about them it was stated only, (Deuteronomy 2:9) “Do not contend with them in battle”; but the Midianites, however, had got excited (had interfered) in a quarrel that did not concern them. Another explanation of why God forbade them to wage war against the Moabites, and which explains at the same time why they had been forbidden to wage war against the Ammonites (cf. Deuteronomy 2:19): because, said He, of the two goodly doves (virtuous women) which I am to bring forth from them, — Ruth the Moabitess, and Naamah the Ammonitess [Solomon's wife] (Bava Kamma 38b).
Rabbeinu Bahya
מאת המדינים, “from the Midianites.” Why single out the Midianites? Did not the Moabites initiate the whole scheme of cursing the Jewish people and, when that failed, the seduction by their women as we know from Numbers 22,7 and 25,1? The fact is that whatever the Moabites did was prompted by a genuine fear of the Israelites as reported in the Torah in detail in Numbers 22,3. After all, although G’d had told the Jewish people not to harass and make war against the Moabites, this did not preclude them from robbing their belongings, etc. The Midianites, however, had gotten involved in an argument which did not concern them at all. The Jewish people had no designs on their country and posed no threat to them. Furthermore, [Moab is not specified] because King David is a descendant of theirs.
Ramban
AND MOAB WAS SORE AFRAID OF THE PEOPLE. The meaning of this is [that Moab stood in great fear] because they [the Israelites] were many,1The Hebrew text reads: ki rav hu. This can be interpreted as “although they were many,” in which case the reference would be to the Moabites, [the word ki meaning “although”]. The meaning of the verse would thus be: “And Moab was sore afraid of the Israelites although they [the Moabites] were many, Ramban, wishing to exclude this interpretation, for the reason cited in the text, explains that the word ki here means “because”; hence the pronoun hu — “they” [they were many] refers to the Israelites. for Moab was small among the nations;2See Obadiah 1:2. and it was not an ancient people, like the Canaanites, the Amorites and other [nations of the] sons of Noah. Therefore they [the Moabites] were greatly afraid of the people who outnumbered them exceedingly, for they were fruitful, and increased abundantly, and waxed3Exodus 1:7. greater than the Moabites. And they were furthermore overcome with dread because of the children of Israel,4Verse 3 here. — Hence the double expression of the verse: And Moab was sore afraid … and Moab was overcome with dread. for they had heard of the great wonders that had happened to them and their fathers. Now Moab knew that Israel would not take their land from them, since they had sent to them [offering peace]5Judges 11:17: And in like manner he sent unto the king of Moab … just as they had sent to Sihon, [asking permission only to pass through their land], saying, until I shall pass over the Jordan into the Land which the Eternal our G-d giveth us.6Deuteronomy 2:29. Or it is also possible that they had heard of G-d’s prohibition, when He said to the Israelites, Be not at enmity with Moab.7Ibid., Verse 9. Therefore they said to the elders of Midian: “Even though the Israelites will not capture our land, they will lick up because of their great numbers all that is round about us, as the ox licketh up the grass of the field,8Verse 4 here. and they will capture all [the lands] that surround us, just as they did to the two Amorite kings, and they will make us servants to do taskwork.”9Joshua 16:10.