Well there are two ways that come to mind.
It is clear that when $x=y$ we have $x^3-y^3=0$. Then use long division to divide $x^3-y^3$ by $x-y$ and the result will be the equation on the right.
Another way would be to write:
$$\left(\frac{x}{y}\right)^3 - 1$$
Now we wish to find the zeros of this polynomial. These correspond to $\frac{x}{y} = 1$, $\frac{x}{y} = e^{i\frac{2\pi}{3}}$ and $\frac{x}{y} = e^{i\frac{4\pi}{3}}$.
Then we can factor the polynomial as:
$$\left(\frac{x}{y}\right)^3 - 1 = \left( \frac{x}{y} - 1 \right) \left(\frac{x}{y} - e^{i\frac{2\pi}{3}}\right) \left( \frac{x}{y} - e^{i\frac{4\pi}{3}} \right)$$
If we multiply the last two factors together we find:
$$\left(\frac{x}{y}\right)^3 - 1 = \left( \frac{x}{y} - 1 \right) \left(\frac{x^2}{y^2} - \frac{x}{y} \left(e^{i \frac{2\pi}{3}} + e^{i \frac{4 \pi}{3}}\right) + 1 \right)$$
$$=\left( \frac{x}{y} - 1 \right) \left(\frac{x^2}{y^2} - \frac{x}{y} \left( 2 \cos(2\pi/3) \right) + 1 \right) = \left( \frac{x}{y} - 1 \right) \left(\frac{x^2}{y^2} + \frac{x}{y} + 1 \right).$$
Thus $$\left(\frac{x}{y}\right)^3 - 1 = \left( \frac{x}{y} - 1 \right) \left(\frac{x^2}{y^2} + \frac{x}{y} + 1 \right).$$ Multiplying by $y^3$ on both sides gives the result.