system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: the difference between a legal and an illegal war.

Yes, I know there are numerous treaties and conventions governing conduct in war but is war itself legal and is there a distinction between a legal and illegal war?
gpt
In just war theory we can distinguish between *jus ad bellum* (right to war) and *jus in bello* (right in war). The first concerns itself with what are justifications for going to war, and the second with proper conduct when in war. Together these can be seen as the law of war. Over time there has been a number of sources for 
law of war, most famously the Geneva convention. 

One of the biggest concepts in international politics is sovereignty. All states have sovereignty, which means that whatever happens within their borders is their own concern, and other states can't violate this sovereignty.

Currently, in international law there are two main reasons when going to war is seen as legal and thus acceptable to the international community. First is self-defense. Second is if the UN Security Council permits it. Since the 1990s there is also the introduction of the concept of Resonsibility to Protect, which means that the international community should intervene in gross human rights violations, even if those are happening within a country and thus intervention violates the sovereignty of that country. R2P however is not something that states can unilaterally invoke, it should go through the United Nations.

Because of this, any act of war that is started without Security Council clearance and that is not committed in self defence is illegal under international law.