DFS searches as deep as possible before backtracking. When you want the shortest path in an unweighted graph, this causes problems. DFS might dive nodes deep before finding the target, when the target was only steps away from the start. There is no guarantee DFS finds the shortest route.
You need an algorithm that explores nodes in order of their distance from the source. That is where BFS comes in. BFS expands outward from the source like ripples in water, visiting all nodes at distance before any node at distance .