Ramban in Parshas Matos asks why the halachos of giyul keilim, how to kasher the utensils obtained from non-Jews, were given only after the war with Midyan and not after the wars with Sichon and Og. Ramban answers that the gemara permits “katlei d’chaziri,” eating fleshpots of pig, during the fourteen year period of fighting for the conquest of Eretz Yisrael. The wars against Sichon and Og were wars of conquest fought for the sake of yishuv ha’aretz, as these lands would be incorporated into Eretz Yisrael; therefore the heter to eat tarfus and use utensils that had absorbed tarfus applied to these battles. The war against Midyan was not a war of conquest for territory, as the Jewish people could not take Midyanite land; it was simply a war against an oppressive enemy. The utensils obtained after this battle required kashering before use.
The Rambam (Melachim 8:1) writes that the heter to eat tarfus has nothing to do with the conquest of the land. It applies to any war, but only when soldiers have no other food to eat and are starving:
חלוצי הצבא--כשייכנסו בגבול הגויים, ויכבשו אותם וישבו מהן--מותר להן לאכול נבילות וטריפות ובשר חזיר וכיוצא בו, אם רעב ולא מצא מה יאכל אלא מאכלות אלו האסורים; וכן שותה יין נסך
Rambam’s view seems difficult to explain in light of a question the gemara in Chulin (17) raises. Before war started, if a Jewish soldier had neveilah, he of course could not eat it. Once war began, he could eat even treif food in the enemy’s camp. The gemara asks what about that piece of neveilah that the soldier had from before the war? Do we say that that once categorized as asur, the status of the meat remains unchanged, or does the start of battle not only lift prohibitions going forward, but even lifts the issur on that piece of meat obtained beforehand?
If, as the Rambam writes, the soldier can eat treif food only under duress to avoid starvation, the whole question makes no sense – of course all prohibitions should be lifted to spare human life. If starvation is at hand, why would there be any issur of eating the treif meat, no matter when it was obtained? The question seems to makes sense if we assume like the Ramban that the heter for tarfus is not based on pikuach nefesh, but rather is a unique dispensation at times of war.
By coincidence, as we shall bl”n see, this gemara sheds light on the question of what to do with your leftover fleishigs now that the nine days are here.
Not immediately after the return from battle, but only after hearing the halachos of kashering utensils, do the soldiers approach Moshe to offer a korban after the battle with Midyan. Why did they wait? The Sefas Emes explains that we learn from the parsha of kashering utensils that not only is the glaringly obvious piece of bacon treif, but even undetectable flavor absorbed in a pot is off-limits as well. The soldiers applied the lesson to themselves -- not only did they have to be concerned for obvious acts of sin, which they had avoided in the war, but they had to concern themselves with the more subtle infleunce of sin that may have penetrated to their neshamos.