Broadly, it comes about because it is often possible to apply some kind of manipulation to an expression that looks valid, but which is actually disallowed by something that is sneakily ignored. In the case of series like $1-1+1-1+\ldots$ and the like, the thing being ignored is that the proof only shows that if it has a value, then that value is the one you get from the algebra used. However, the fact that the series is divergent by even the simplest of tests shows that there isn't a meaningful value to the series, so the fact that we found out what that theoretical value is doesn't actually mean anything.
A similar principle applies to the various fake proofs that $0 = 1$ and the like - one of the steps typically introduces an additional solution (or removes an assumption) in a way that isn't immediately obvious. For example, starting with the assumption that $a = b$, then later multiplying something by $a - b$, or taking the square root of something and not considering the negative root.