רמב"ן
Ramban on Numbers 21:1
Q — 'וישב ממנו שבי' — the Canaanite king of Arad took captives from Israel. But Chazal hold that 'לא יהיו ישראל מנוצחים כלל מאויב זולתי בעת קלקלתם,' and no sin is recorded here. Chazal solve this by reading 'שבי' (singular) as a single shifcha (a previously-captured Canaanite woman recovered).
A — Ramban offers an alternative peshat. The principle of 'לא נפקד מהם איש' covers fatalities — no one was killed. Captures, however, can occur even in unblemished conditions; they were recovered on victory ('כאשר נתן ה' אותו בידם השיבו את הכל'). The Torah mentions this episode specifically to motivate the cherem-vow Israel then made. And a striking aggadic supplement: Hashem made this Canaanite king succeed initially as a setup — he had come from afar 'לא ירא אלהים' to fight Israel and Hashem wanted him devoted to cherem. The initial success drew Israel's vow, which sealed his destruction. 'אויבי הקדוש ברוך הוא למפלתן הן מתגדלין.'
ועל דרך הפשט, ענין הכתוב כי לא הרג מהם הכנעני הזה שום אדם, אבל ָש ָבה מהם מעטים וכאשר נתן ה' אותו בידם השיבו את הכל, ולא נפקד מהם איש. והזכיר הכתוב זה, להודיע כי מפני שראו ישראל מתחלה כי גבר הכנעני נדרו הנדר הזה להחרים כל שללם לה' וישמע ה' בקולם. ויתכן שנאמר עוד, כי קצף ה' על הכנעני הזה בעבור שבא מארץ מרחקים להלחם בישראל ולא ירא אלהים, ורצה שיהיה לחרם, על כן הגביר אותו מתחלה כדי שידרו להחרימו לה'.