useClass provides a class to be instantiated. useValue provides a static value or mock object. useFactory provides the return value of a factory function that supports async and dependency injection via the inject array. useExisting creates an alias so two tokens resolve to the same singleton instance.
useClass — NestJS instantiates the class and manages its lifecycle.
useValue — the value is used as-is; no instantiation or lifecycle management.
useFactory — the inject array lists tokens resolved and passed as factory arguments in order.
useFactory supports async; NestJS awaits the returned Promise before the app starts.
useExisting — does NOT create a new instance; resolves the existing singleton for the referenced token.