A so called "international law" (an oxymoron) is not really a law since it is not pronounced by any authority that has the power to enforce it.
Game theory predicts that, in a multiperiod game, it might be optimal for players to conform to such rules and to enforce them by consensus. This can be true even when agents are rational, and can be more likely true when agents are "wet computers". For example, it might be optimal for a warring nation to avoid committing a "war crime" (another oxymoron) because such an act might enrage and motivate and unite an opposing army.