I am reading Proofs and Confirmations, the history behind the alternating sign matrix conjecture, regarding counting $n \times n$ alternating sign matrices. In the introduction, it is written that the people (Mills Robbins and Rumsey) behind the ASM conjecture added an extra parameter (the position of the 1 in the first row), and by using this refined count, managed to guess a beautiful formula.
There are other examples where refining the family reveals beautiful extra structure. My current personal favorite is counting crossings in perfect matchings. $$ T_n(q) := \sum_{M \in PM(n)} q^{crossings(M)} = \frac{1}{(1-q)^n} \sum_{j=-n}^{n} (-1)^j q^{\frac{j(j-1)}{2}} \binom{2n}{n+j} $$ see A067311. The formula on the right hand side is not that nice, but by refining crossings by gathering matchings according to which vertices are starting vertices, one can easily prove that $$ T_n(q) = \sum_{a \in Area(n)} \prod_{i=1}^n [a_i+1]_q $$ where the sum is now over Catalan$(n)$ objects, namely area sequences of Dyck paths. This example IMHO illustrates that refining a problem can reveal nicer properties. (From this formula, one can apply general theory by Flajolet and immediately get a nice continued fraction expansion).
Another famous example would perhaps be the recent proof of the shuffle conjecture, which really relies on the refined conjecture (the compositional shuffle conjecture).
Question: What are some legendary examples where refining the problem made a significant impact on the solution? Your favorite example?