Looping issues

Looping issues

Can someone please explain why this doesn't infinitely loop, but the second one does? How can I get around this?

This one loops ⬇️