Inheritance is a method that allows the creation of a new class based on an existing class. Essentially, the new class inherits the attributes and behaviors of the original class, which promotes reusability and facilitates the addition of new features to the existing class. This establishes an "is-a" relationship. For example, if we define a class called "Animal" and another class called "Dog," we can assert that "Dog is an Animal." This concept is particularly relevant in situations where there is a class hierarchy. In contrast, composition is a design approach in object-oriented programming where a class consists of other classes, signifying a "has-a" relationship. In simple terms, composition involves one class containing or incorporating one or more classes. For instance, a car "has an" engine, which exemplifies this concept. Composition offers greater flexibility as it allows for modifications to class members without impacting other classes, thereby enhancing the robustness of the system.