http://revach.net/article.php?id=2526

Section: Taryag Mitzvos   Category: Taamei Hamitzvos
Parshas Matos: Torah War Strategy - Battle To The End?
“VaYitzbi’u Al Midyan KaAsher Tziva Hashem”, they fought Midyan the way Hashem commanded.  The Sifri says that when you wage war on a city do not surround it on all for sides.  Surround it from three sides and leave a fourth side to allow the enemy to escape.  The Smag and the Ramban both hold that this is one of the 248 mitzvos Aseh.  The Rambam (Milachim 6:7) brings this down L’Halacha but does not count it among the Mitzvos Aseh.

The Radvaz on the Rambam says the reason for this Mitzva is to allow people to flee death.  It is the last chance for Rachamim.  This last gesture is granted despite the fact that they were already offered to surrender and live in peace yet refused.  All this says the Radvaz, is because the ways of the Torah are “Sholom”.

The Ramban gives the same reason as the Radvaz and adds another strategic reason.  If someone has their back to the wall with no way of escape, they will fight viciously until the bitter end.  Do not strengthen their resolve against you, says the Ramban.  Let them know there is another option.