Necessity and self-defense are legal defenses used to justify actions that would otherwise be considered tortious or criminal. Necessity involves acting to prevent a greater harm, while self-defense is about protecting oneself from imminent harm. Both concepts aim to provide a legal excuse for actions taken under extreme circumstances, but they differ in their application and underlying rationale.