War is the most drastic means of resolving conflicts between two or more nations; therefore, certain rules and codes of conduct are put into place to ensure that war is fought fairly and not entered into lightly. Collectively, all of the philosophical doctrines about how and why war is fought are known as the just war theory. The theory comes from the just war tradition, which originates in warfare between nations with similar cultural ideas that agree upon a mutual code of conduct. Three main components make up the theory: jus ad bellum, for the causes of war; jus in bello, for conduct during war; and jus post bellum, for the aftermath of war.
The first part of the just war theory, jus ad bellum, determines the justifiable causes for a nation to act as the aggressor in a war. Such reasons include having just cause, turning to warfare as a last resort after all peaceful means of conflict resolution have failed, and possessing good intentions. In all cases, actions taken should be proportionate to the cause. Just cause for warfare does not include acts of revenge for prior actions. The only commonly accepted justification for war is defense against a physical attack or expansion into territory by the offending nation.
During times of war, the policy of jus in bello applies. This part of the just war theory focuses on details about codes of conduct to be observed during the fighting; typically, the two areas covered are discrimination and proportionality. These two concepts refer to which parties are considered lawful combatants and what actions can be taken toward them. The Hague Court and the Geneva Conventions form most of the jus in bello doctrine in modern times. Examples of the doctrine include the expectations that civilians are not to be targeted, that combatants must be given an opportunity to surrender and that the use of chemical or biological weaponry is prohibited.
After war is completed, certain rules are applied under jus post bellum. Just war theory requires that actions toward defeated nations in the aftermath of war should be proportional to the extent of the war and should not affect the lives of civilians. An example of jus post bellum being violated is the Treaty of Versailles after World War I, wherein Germany was made to pay all reparations for the war despite being only one of the parties involved. The treaty caused the German economy to plummet, leading to Hitler's rise to power and World War II.