A state of affairs is necessary if it has to be the case. Logical necessity is a product of the law of noncontradiction. Causal necessity, it has been thought, is a different form of necessity.
A situation that compels an act because of some need; can provide grounds for an affirmative defense. See full article titled Defenses of Necessity and Choice of Lesser Evils
A person is excused from criminal liability where he acts in an emergency to protect life, health or property in a reasonable way and with no acceptable alternative. The law will excuse the commission of a lesser evil to avoid a greater evil when there are no other peaceful, effective alternative remedies open. The circumstances in which this defence might apply cannot be defined beforehand.