Suppose a UserService has four optional extras: logging, auth, caching and metrics. Each extra is either on or off. That gives 2 to the power of 4, or 16, combinations. With inheritance you would need a subclass for each mix you use, with names like LoggingCachingUserService. The class tree grows fast and becomes hard to change.
With decorators you write four small wrappers, one per extra. You pick the ones you need when you build the object, at runtime. Adding a fifth extra means writing one more wrapper, not doubling the number of classes.
Each wrapper also has a cost the lesson lists. A logging layer adds about 0.1 ms per call. A retry layer adds nothing on success and 200 to 1,600 ms when it retries. A cache layer returns in under a millisecond on a hit and skips every layer inside it.