There are (at least) two ways to interpret "extraneous roots".
One is that roots relate back to a physical context. In such a scenario, it is not necessarily the case that there are any "real" roots at all—real here referring not to whether or not it's a complex number (involving $i$, the square root of $-1$), but whether it fits the physical context. Often, it's merely negative, and because the variable is modeling a non-negative number (e.g., the number of books in a pile), the root is considered extraneous.
If, say, a quadratic equation has two roots, and neither of them fits the physical context, then both of them are extraneous, and there are no "real" solutions at all. That just means that the constraints of the problem cannot be satisfied.
Another way to interpret "extraneous roots" refers specifically to roots developed because of a non-invertible transformation of some original equation. (Squaring is the most common example of this transformation, as you point out.) Under what circumstances this happens and what its implications are is a different set of questions.
There still isn't guaranteed to be a non-extraneous root, though. Consider what happens when you square both sides of
$$
-|x| = \sqrt{2x^2-1}
$$
One obtains
$$
x^2 = 2x^2-1
$$
or
$$
x^2-1 = 0
$$
which clearly has the roots $x = \pm 1$, but neither of those is a root of the original equation.