Recall that BFS finds the shortest path by expanding in layers. Layer ( step away), then Layer ( steps away), etc. This assumes that " step" always equals "distance ".
But look at this graph: (Distance ) (Distance ) (Distance ) BFS will see immediately ( step) and declare the distance is .
But the path is distance . BFS fails here. You need something smarter.