At its core, Nest.js provides a robust dependency injection system for resolving dependencies within your application. While a typical use case might be to inject a database connection into any service classes that need it, where this can really shine is when your application relies on one or more external service(s).
Typically when building apps in Express you’ll be using some sort of persistence mechanism, whether that is a relational database, NoSQL database, or another object store. Certain circumstances require using two stores simultaneously, perhaps if you want to use an RDBMS as a source of truth but leverage something like Redis as a cache to boost overall performance. Whatever technology you’re using in your application, you’ll want to ensure that connections are established (or have failed fast) before you fully boot your app.