Think of the inner while loop as a single statement, inside the outer while loop. So, on the first iteration of the outer loop, the inner loop will execute in its entirety, just like every other statement in the outer loop.
Then, on the second iteration, the inner loop will execute in its entirety again, just like every other statement in the outer loop.