Was the idea here that because the UN declares that war is illegal, that no country will do war anymore?

I mean, wtf.

After WW1 and WW2 and with the threat of nuclear war, people were willing to try any amount of talking as a less horrific option.