Given a formula for $\pi$ like:
$$4⋅\sum^\infty_{k=1} \frac{(−1)^{k+1}}{2k−1} = 4⋅(1−1/3+1/5−1/7+1/9−1/11…).$$
or some of the several others; how can you know that it holds true to any $k$? Couldn't it be that from a certain value upwards, the series start to diverge from $\pi$?
The answer depends on where you want to start.
You can start with the definition of $\arctan x$, develop the series expansion for that, and then plug in $x=1$ to set the whole thing equal to $\pi/4$. Or you can calculate it geometrically the way Leibniz did.
Absent equating the series to some multiple of $\pi$ you can calculate two series that approach $\pi$ from above and below, and then squeeze out an expression for $\pi$ that way.
But the answer to your question is that often the series pops out from some expression which is already known to be a multiple of $\pi$.