Entities point at each other through navigation properties: an Order has a List<OrderLine> Lines, and each line has an OrderId foreign key. EF Core does not load related rows unless you ask: query orders alone and order.Lines is empty. db.Orders.Include(o => o.Lines) loads the orders and their lines together.
The classic performance bug is N+1 queries: load 100 orders, then query the lines of each order in a loop, and the page makes 101 round trips to the database. It is invisible with three rows on a laptop and painful with real data. The fix is to load what you need in one query (Include), or in two (all orders, then all their lines), never one per row.
Adding works the other way round: add an order whose Lines list holds new lines, call SaveChanges once, and EF Core inserts the order, then the lines with OrderId filled in. For read models, project with Select into a small record, so the query returns exactly the columns the screen shows.
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 LINQ runs as ordinary LINQ. The stand-in counts the queries it runs in db.QueryCount, which real EF Core does not have (it shows queries in its logs). Include takes one collection property and does not chain to ThenInclude.
Include loads children with their parents, and one SaveChanges inserts a parent with its children.