Inheritance allows a class (subclass) to inherit attributes and methods from another class (superclass), facilitating code reuse and hierarchy.