Never mind my previous comment, you've adjusted with hotspots.
Any way, the way it works is like a deck of cards.
The cards on the bottom of the deck would have a lower y value than the cards going to the top.
If you look at the for each you will see it has the ability to do the order ascending, that is to say low to high.
So the loop starts with the lowest y value object and sends it to the top of the layer, and then goes to the object that was just above that one, and then sends it to the top. That object is now visually on top of the first object.
This is repeated for all the objects so in the end you have basically stacked a bunch of cards in order.