An invariant is a condition that must always hold true for an object. In a class, invariants help maintain valid states across mutations. For instance, in a `BankAccount` class, an invariant might be that the `balance` must never be negative. By enforcing this through methods, you ensure the integrity of the object's state.