How this example works
The container wraps when space runs out. Changing justify-content redistributes each line independently along its main axis.
Try a change
Switch flex-direction to column and set a min-height on the container. Try align-items: stretch and compare the two axes.