After a great and terrible conflict on Earth, known as World War II to the planet's inhabitants, the various nations that survived the war put in place a set of guidelines which specified certain actions and weapons to be unacceptable in the course of a war, such as forbidding the use of poisonous gasses, or the intentional slaughter of innocent civilians. These guidelines became known as the Geneva Conventions, and they were, for the most part, upheld by the nations of the world. Primarily this was due to the so-called "Cold War" between rival superpowers bearing nuclear weapons, who feared each others' ideologies as much as a nuclear conflagration.
For a period of time after one of the global superpowers lost the "Cold War," it appeared that the remaining superpower would uphold the Geneva Conventions, and act as a pseudo-police unit for nations that did not. However, following a devastating terrorist attack on the superpower's largest city, it undertook a series of actions that directly contradicted the Geneva Conventions, such as condoning the use of torture. Other nations followed suit, and after a period of time, the Geneva Conventions were seen as a lofty goal at best, and an encumbrance at worst.
Therefore, I ask: what conditions could ensure that the rules of war be followed in a society of states where there is no undisputed hegemon? I exclude the possibility of hegemony as it is 1: unlikely in our culture for the foreseeable future; 2: not guaranteed to be gentle or just, considering how many people would have to be put down for opposing a single world government; and 3: there is little assurance that a traumatic event such as a massive famine or terrorist attack would not result in societal upheaval that is violently suppressed.
EDIT: I am only using Earth and human history as an example of how global rules can be imposed and later broken. The answer need not necessarily reflect the history of humans on Earth.