If we only talk about transforming equations, then spurious solutions may appear whenever we apply a function $f$ to both sides that is not injective. In other words, we have $a=b\implies f(a)=f(b)$, but not vice versa. The case of squaring both sides is just a special case of this (with $f(x)=x^2$). Similarly, taking roots is like the attempt to go from $f(a)=f(b)$ to $a=b$; but in general that is not valid, i.e., we may lose solutions.
The effect may also occur when doing thíngs that are normally more harmless things (i.e., applying more innocent-looking $f$), such as multiplying both sides by an expression: Thus expression _may_ accidentally be zero and thereby introduce additional solutions (because multiplication by $0$ is far from injective).
Beware that even when we do not transofmr an equation as a whole, we may fall for these traps, e.g., when replacing $\sqrt{x^2}$ with $x$; this is valid only if we knwo that $x\ge0$!