Here's a very quick sketch, which uses the concept of Van Kampen diagrams. Let the boundary of $D^2$ be broken into oriented edges labelled by the letters of the word $w$.
When you identify a relation $r=r_1 r_2$ as described in your question, find the oriented arc $\alpha$ in the boundary of $D^2$ which is labelled by $r_1$, connect the ends of $\alpha$ by an oriented chord $\beta$ so that $\alpha \beta$ is a closed curve, and subdivide $\beta$ into oriented edges labelled by $r_2$, so that $\alpha\beta$ is labelled by $r_1 r_2$. You can now think of $\alpha \beta$ as the boundary of a 2-disc which, upon removal from $D^2$, forms a smaller 2-disc whose boundary is labelled by the shorter word $w_1 r_2^{-1} w_2$.
Now proceed inductively: in the next step of the induction, one applies the procedure above to the subdisc bounded by $(\partial D^2 - \alpha) \cup \beta$, and so on.
When the procedure is complete, you will have subdivided $D^2$ into a cell complex with at most $l(w)$ 2-cells, every 1-cell will be oriented and labelled, the labels around every 2-cell will be a (cyclic conjugate of) a relator, and the label around the boundary circle is the original word $w$. This labelled subdivision is called a "Van Kampen diagram" for the original word $w$. (I am sweeping some subtleties under the rug, which you might observe by looking at that wikipedia link)
Now you just have to convince yourself that the existence of a Van Kampen diagram with $N$ 2-cells implies that existence of a product formula for $w$ with $N$ factors, as you have written it. You may have seen this kind of argument before, if you ever worked your way through the proof of the Seifert-Van Kampen theorem.