There’s a short phrase that goes with each concept—composition means “has-a” and inheritance means “is-a”.
I definitely understand if that might not help you much right now, but what that means in plain English is that with composition, one class is a component of another; but with inheritance, one class is another but with added functionality.
If you take for example the concept of a Vehicle class, you might have related classes for the parts it contains—the body, engine, tires, windows, etc. These separate classes are all related to the Vehicle class through composition, and it can be said that the Vehicle “has a” body, engine, tire, window, etc. And when you create classes for types of vehicles, like Sedans, SUVs, Trucks, etc, those classes would be related to Vehicle through inheritance, because they all have a body, engine, tires, windows, etc. And in that case, you can say a Sedan “is a” Vehicle, or a Truck “is a” Vehicle. So that explains where those phrases come from.