US President Donald Trump proclaims apocalypse. "They will be met with fire, fury and frankly power the likes of which this world has never seen before." At his New Jersey golf club, he proclaimed again, "If anything, maybe that statement wasn't tough enough."

In doing so, he raises the spectre of war.

His casus belli is way over on the vague side. "They've been doing this to our country for a long time, for many years, it's about time somebody stuck up for the people of this country ..." What is "this"? And what is it doing to the United States? Has the US suffered from North Korean incursions? Have we missed them?

Trump's warmongering rhetoric raises the question: would a war be legal?

There are many people who may think that debate is academic. Trump - and America - can, and will, do what they want, and no lawyer will stop them. However, the rules are worth knowing for their own sake and an examination of their history reveals a great deal about the nature of war.

As a general rule, aggressive war is illegal. In almost the same way, that a physical assault by an individual on another person is illegal. Technically, it was outlawed in 1928 by the Kellogg-Briand Pact. Most of the participants in the second world war were signatories, so it became the legal foundation for the prosecutions at Nuremberg where the underlying principle was reiterated:

"War is essentially an evil thing. Its consequences are not confined to the belligerent states alone, but affect the whole world. To initiate a war of aggression, therefore, is not only an international crime; it is the supreme international crime differing only from other war crimes in that it contains within itself the accumulated evil of the whole."

The Kellogg-Briand pact remains in effect. The UN Charter also outlaws aggressive war. It's effectively a treaty and the US is a signatory.

The fundamental exception - as in criminal law - is self-defence. Any nation that's physically attacked has the absolute right to fight back.

WATCH: The rise of Trump - Fault Lines (24:57)

Additionally analogous, the UN envisions the idea of a police force with the right to employ violence with proper authorisation. The Korean War and the Gulf War were both UN-sanctioned wars.

The idea of self-defence is sometimes stretched to validate "preventive" and "pre-emptive" war, words and concepts that are very easily confused and conflated.

The first "case" of preventive war was in 1837. A minor rebellion was taking place in Canada. The rebel base was on an island in the Niagara River. They had a steamboat, called the Caroline, which they used to ferry their forces (terrorists?) and their arms (weapons of individual destruction). To protect it, they kept it moored in a foreign country, the United States. Despite that, the British crossed over one night and set it on fire, killing one American in the process.

It was, without doubt, an invasion. It seemed as if it would be the casus belli of another war between England and the US.

The interesting thing is that it was not the aggressors, it was the "victim" that came up with the legalistic notion of "preventive" war. It was precisely and narrowly defined. "The necessity of that self-defense is instant, overwhelming, and leaving no choice of means and moment for deliberation." It could not be an excuse for all-out war. It had to be limited to fixing a limited problem: "Nothing unreasonable or excessive; since the act, justified by the necessity of self-defense, must be limited by that necessity, and kept clearly within it."

"Pre-emptive" war is very different. Countries go to war based on the conviction that the other guy is going to attack them and the only thing to do is be first to the battlefield.

The best pre-emptive wars are imaginary: if England had struck Germany in 1936; if the Soviet Union had struck Germany in 1941; if the US had struck Japan before Pearl Harbor.

Here are some examples of real pre-emptive wars: Germany's attack on the Soviet Union in 1941; Japan's attack on the US in 1942; the Confederate States against the Union in 1861; and China's entry into the Korean War in 1950.

However militaristic the US has been, ideologically it had always rejected the idea of pre-emptive war. Until it was re-packaged as "Bush Doctrine".

"… as a matter of common sense and self-defense, America will act against emerging threats before they are fully formed.

"… rogue states and terrorists … rely on acts of terror and, potentially, the use of weapons of mass destruction … the greater the threat, the greater is the risk of inaction - and the more compelling the case for taking anticipatory action to defend ourselves."

That gave the world the second war in Iraq, which was a disaster.

A very strong argument can be made that the disaster was due to the moral dimension of war. When a country, or a people, is attacked it creates a level of moral outrage that is almost bottomless. When a country is the aggressor, especially when it was a war of choice - possibly with perceived necessity, but not real necessity - it does not win. They may not lose, as Germany and Japan did in World War II, but they fail to "win," like Russia in Finland, China in Korea, and the US in Iraq.

Laws, at their base, are an attempt to bring reality under control by codifying it. War is damaging, destructive, "the supreme international crime differing only from other war crimes in that it contains within itself the accumulated evil of the whole." Laws about war might seem academic, but they're not. They're an excellent guide to avoiding destruction and failure.

Larry Beinhart is a novelist, best known for Wag the Dog. He's also been a journalist, political consultant, a commercial producer and director.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.