AddDbContext method for DI

How does this IOptionsAccessor stuff normally get added? That is, in a normal app scenario how does it get in the service collection?