For certain operations, IdentityServer needs a persistence store to keep state, this includes:

issuing authorization codes

issuing reference and refresh tokens

storing consent

You can either use a traditional database for storing operational data, or use a cache with persistence features like Redis.
The EF Core implementation mentioned above has also support for operational data.

You can also implement support for your own custom storage mechanism by implementing IPersistedGrantStore - by default IdentityServer injects an in-memory version.