International law. The US- and many other countries- have long held that enough countries joining make international laws binding on all countries, even if that country did not sign a particular treaty. (1) This doctrine sprang up after the great POW slaughters on the Eastern Front during WW2 (2) made it untenable to allow countries to avoid their responsibilities under the treaties by not signing or to invade a country that did not sign.
1: This is complicated on the Ottawa Treaty, where the US and a few other countries have held out- though at least under most administration's the US considers itself bound by Ottawa everywhere except on the Korean peninsula.
2: The USSR did not sign the Geneva Convention of 1929 (they wanted POW's to be explicitly allowed to form political organizations- e.g. Soviets, and to not be allowed to discriminate against POW's, while Article IX of the Convention mandated that POW's be racially segregated "as far as possible") and so the Nazi's technically did not break the convention in their horrible mistreatment of Soviet POW's that led to millions of deaths.