The idea of a body of laws to govern war seems like a contradictory notion at first.
After all, the whole point of war is death on an industrial scale. Why wouldn't you want to use any and all means necessary to defeat your opponent? Isn't that the whole point?
In a word, no.
Historically, wars have rarely been about the complete and utter annihilation of the enemy. You break them, sure. Crush their ability to fight and extinguish their will, absolutely. Enslave the citizens and put their cities to the torch if that's your thing. Conquering armies got to do that sort of thing back in the day.
However, as warfare became progressively more deadly, we began to realize that there had to be limits. Chemical or biological warfare could destroy entire populations with ease. Nuclear weapons could wipe cities off the map. To go down that road, however, is to plant the seeds of your own destruction.
One of the oldest military axioms tells us why: when on dangerous ground, devise stratagems. When on deadly ground, fight.
An enemy with their back to the wall has nothing to lose. They will fight with everything they have, and if they have to die, they're going to take out every last enemy they can. Desperation is a powerful force multiplier.
It was for this reason more than any other that the practice of allowing your enemy to surrender became popular. Life as a prisoner or slave might have been hellish, but it was still life, and where there is life, there is hope. On the other hand, if death is the only option, a nation will go down as hard as possible. If that means lobbing a few jars of anthrax or VX, well, they won't be around to live with the consequences.
When two or more nations with rough parity in terms of military might and economic resources decide to throw any last remnants of civility out the window, the one thing that they can count on is that neither side will be left standing at the end.