According to Angular Docs, you can inject a different object when a provider is a required. When I looked for good reasons to do this, the only information that I found has been the following:
Suppose an old component depends upon an OldLogger class [...] but for some reason you can't update the old component to use it.
I'm still doubtful. Why, in some cases, I couldn't update the old component? It's not dangerous if a Component or a Directive expects a class and we inject another one? What are the cases where using provide and useClass is essential?