The idea is that you can write a
SELECT SQL statement, which, when executed, creates a cursor driving the loop. The Flow in a database loop is executed many times as the number of records returned by the cursor. For every field in each record in a cursor, the system automatically sets the global and Flow variables. This technique is also called a database loop.
Read how to create a database loop.