Subtree DP processes trees from leaves to root. You compute values for leaf nodes first, then use those to compute values for their parents, and so on up to the root. The pattern: dp[node] = f(dp[child_1], dp[child_2], ...) You combine child answers to get the parent answer.
This works because trees have no cycles,each node depends only on descendants.