Mental Model
We want to find the biggest sum of values along any path in a tree, where a path can start and end at any nodes. We use a method that remembers best sums from children to avoid repeating work.
Analogy: Imagine a tree of roads with tolls on each road. We want to find the most profitable route that can start and end anywhere, but we calculate profits from bottom roads up to avoid checking every route again and again.
1
/ \
2 3
/ \ \
4 5 6
Each node has a value. We want the max sum path anywhere in this tree.