The for loop creates a variable, which is a name that represents a value. Here, the variable is an integer named i. The for loop sets this variable equal to 0 and checks whether i is less than 5. If it is, then the program executes the four lines of code within the loop. These four lines of code make the LED blink green once. Then the program goes back to the top of the for loop and increases the value of i by 1 (i++). It checks again whether i is less than 5 and executes the four lines of code within the loop, blinking the LED again. This process continues until i is equal to 5. When i is equal to 5, the program checks i < 5 and and finds that it is false. The loop ends; the program skips the lines of code inside the loop and moves on to whatever code follows the for loop.
Notice that the four lines of code inside the for loop are contained within curly braces. This is how Java knows what is inside the for loop. All the lines within the braces are inside the for loop, and the next line outside the braces is outside the for loop. For example, this code turns the LED red after the for loop ends.