DFS goes as deep as possible along one path before backing up, which makes it natural to write with recursion. Use it to explore everything reachable, detect cycles, find connected components or produce a topological order. It does not find shortest paths in general, so use BFS for that. On very deep graphs, recursive DFS can overflow the Java stack, and an explicit stack avoids that.