Centroid decomposition handles problems involving paths in trees. Count paths of a given length. Find paths with specific properties. Answer queries about distances or path values.
Here's the main idea: every path passes through some centroid in the decomposition. By processing paths through each centroid, you cover all paths exactly once. You'll see why this matters in the problems.