Suppose you want to compute, for every node in a tree, the sum of distances from to all other nodes. You already know how to do this for one fixed root using a single DFS. Root the tree at node , run DFS, collect subtree sizes and distance sums.
But now you need the answer for node , node , and every other node. The brute force approach is to re-run DFS from each node separately. That gives per node and total. With , that is operations. Far too slow.