Hm yes sorry simplistic analogies like this are always hard to reason about. In real life, the verdict would depend on the laws of your country, if self defence was proportionate, etc. Also, if you focus only on your personal gain, it makes sense to kill your mugger.
However, that's not what I had in mind when writing it: I hope that I'm not the only thinking that killing someone who wants to mug you, even by force, is bloody absurd and should be avoided at all costs ? Both because one might not feel good about what they did, even if it was to avoid injury or losing money, and because this mechanic feels very unsustainable, to say the least, on the scale of a society.
Idk if this analogy makes more sense now; of course if you don't share my opinion on this it becomes a pretty bad analogy. Maybe a better one would be wondering why most countries have abolished the death penalty (punishment is proportionate to crime, except when we decide there's a baseline that we won't cross for punishing some crimes that go below said baseline). Similarly, and as other commentators have said, war crimes have been agreed to be the baseline you must strictly respect, regardless of any other circumstances, including uneven conflict.
Do you have more details about that?