In a nutshell
Also called Floyd's tortoise and hare, this detects a loop in a linked structure using two pointers from the same start: a slow one stepping 1 node at a time and a fast one stepping 2. If the path eventually loops, the fast pointer circles around and catches the slow one from behind, so they meet. If there's no loop, the fast pointer just runs off the end. It needs only those two pointers — constant extra memory.