BFS processes nodes in waves. Wave : the starting node. Wave : all nodes step from the start. Wave : all nodes steps from the start. Each wave completes before the next begins. You use a queue to enforce this order. Add the start node to the queue.
Remove it, process it, and add all its neighbors. Remove the first neighbor, process it, add its neighbors. The queue automatically groups nodes by distance because you process parents before children. This creates the layer-by-layer exploration pattern.