BFS uses a queue to perform a traversal of a graph, visiting all adjacent unvisited vertices of the vertex at the front of the queue and adding them to the queue. This produces a spanning tree without loops as the final result, where each vertex in the graph can be reached from the starting vertex without cycles. The queue, which has a maximum size of the total number of vertices, ensures a layer-by-layer search of the graph from the starting vertex out is performed.