Breadth-first search enqueues a start node, removes nodes from the front, and appends unvisited neighbors. It finishes one distance layer before the next.
In an unweighted graph, first arrival gives a shortest path by edge count. Without a visited set, cycles can re-enqueue the same node indefinitely.
When to use
Use it to find minimum hop counts or explore a graph by layers.