Select data
Selecting data is the opposite direction from inserting it. Before, you were sending new rows into the table. Now you are asking MySQL to send rows back to you.
That is what SELECT does. You tell MySQL which columns you want and from which table. If you want only specific columns, you list them. If you want everything, you can use *, though in real code it is often cleaner to ask only for the columns you actually need.
When PHP runs a select query, the result is not just one ready-made value. It is a result set, which is basically a collection of rows returned by the database. Then your PHP code has to process that result.
That is where num_rows and fetch_assoc() come in. num_rows lets you check whether anything came back at all. fetch_assoc() pulls one row at a time from the result set and gives it to you as an associative array, so you can access values by column name like id, name, or email.
That is why the while loop appears here. You usually do not know ahead of time how many rows the query returned, so you keep fetching the next row until there are no more left.
So the flow of this lesson is: run a SELECT, get a result set back, check whether it has rows, then loop through those rows and output what you want from each one.