What is the N+1 query problem?

An application fetches a list of orders, then makes a separate query to retrieve related data for each order. Why is this called the N+1 query problem, how does it slow the application down, and how can you fix it?

ExplainEXPLAIN and optimizationJuniorBackendData Engineer