We being from the well-known geometric series and differentiate
$$\begin{aligned}
\sum_{n=0}^\infty z^n &= \frac{1}{1-z}\\
\implies \sum_{n=0} nz^{n-1} &= \frac{1}{(1-z)^2}.
\end{aligned}
$$
We will differentiate again to get $n^2$ in our series, then add a correction to get the final answer.
$$
\begin{aligned}
\sum_{n=0} nz^{n-1} &= \frac{1}{(1-z)^2}\\
\implies \sum_{n=0} n(n-1)z^{n-2} &= \frac{2}{(1-z)^3}.
\end{aligned}
$$
To get this to the series we want, we need to correct the powers from $n-2$ to $n$ and correct the coefficients from $n(n-1)$ to $n^2$. The first step is done by simply multiplying through by $z^2$. The second step is done by adding $\sum_{n=0}^\infty nz^n$. However, notice that this is just $z$ times the first derivative we calculated, which is $\frac{z}{(1-z)^2}$. Combining these, we have
$$
\sum_{n=0}^n n^2 z^n = \frac{2z^2}{(1-z)^3} + \frac{z}{(1-z)^2} = \frac{z(z+1)}{(1-z)^3},
$$
which is equal to your expression.
As for why we must restrict ourselves to $|z|<1$, this is because the original expression for the gemoetric series (and hence all subsequent calculations) is only valid for these values of $z$. One can easily see that if $|z|\geq 1$, these sums will not converge.