"Ben-Ammi" [son of my people] — because she concealed her father and said that he was only "from my people." And because the elder daughter exposed her father [naming her son Moab, "from the father"] while the younger one concealed him, therefore the Holy One, blessed be He, said to Moses, "Distress not Moab, neither contend with them in battle" (Deuteronomy 2:9) — specifically war, no; but angaria [forced requisition] you may impose upon them. So Israel would go to the cities of Moab armed, and when the Moabites saw them armed, they would flee and leave behind everything that they had, and Israel would come and plunder them. But concerning the children of Ammon He warned them, and said, "do not contend with them in battle" at all.
Why Moab Could Be Plundered but Ammon Was Spared in Battle
Midrash Aggadah, Genesis 19:38
בן עמי. שכסתה אביה ואמרה שלא היה אלא מעמי, ולפי שהבכירה גלתה את אביה והצעירה כסתה אותו, לכך אמר הקב"ה למשה אל תצר את מואב ואל תתגר בם מלחמה (דברים ב ט), דוקא מלחמה לא, אבל אנגריא עשה עמהם, וישראל הולכים אצל עיירות של מואב מזויינים, וכשהיו מואבים רואין אותם מזויינים, היו בורחין ומניחין כל מה שהיה להם, וישראל היו באים ובוזזין אותם, אבל בני עמון הזהירם ואמר אל תתגר בם מלחמה כלל: