Entity Framework Core maps classes to database tables. A DbContext represents a session with the database, and each DbSet<T> property is a table: public DbSet<Product> Products { get; set; }. You query a set with LINQ (db.Products.Where(p => p.Category == "snacks").OrderBy(p => p.Price)), and EF Core translates it to SQL.
Changes are not written straight away. db.Products.Add(product) marks a new row, changing a property of a loaded entity marks it modified, and db.Products.Remove(product) marks it deleted. Nothing reaches the database until SaveChanges() (or SaveChangesAsync()), which writes everything in one go and fills in generated keys such as Id.
EF Core knows what changed because it tracks the entities a query returns. Tracking costs memory and time, so read-only queries add .AsNoTracking(); but changes to untracked entities are never saved. A context is meant to be short-lived: one per request or unit of work.
About the code here: EF Core does not run in this browser runtime, so these exercises use a small stand-in for EF Core with its in-memory provider, with the same names and the same rules for what this lesson checks. It is a simplification: rows live in memory and your LINQ runs as ordinary LINQ, not SQL; SaveChanges, generated keys, tracking, AsNoTracking, Find, ToListAsync and the other names you use here behave as in EF Core.
A context with one table, an insert saved with SaveChangesAsync, and a read-only query.