The Startup class configures an ASP.NET Core app's services and its request pipeline when the app starts. The host calls its two methods, ConfigureServices first:
ConfigureServices registers services, such as MVC, EF Core and logging, with the dependency injection container.
Configure builds the request pipeline by adding middleware in order.
Before .NET 6 every app needed one. Since .NET 6, project templates do the same setup in Program.cs with WebApplication.CreateBuilder, and there is no Startup class. A Startup class still works in newer versions, but Microsoft no longer recommends it.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.