This discovery comes from the following formula:
$$\sum_{k=1}^n (2k-1) = n^2$$ which is read simply as, the sum of the first $n$ odd numbers from $1$ is equal to $n^2$.
We can prove this geometrically, where if we let $n = 1$, we have $1$ box. $$\blacksquare$$ Then when we let $n = 2$, we have to add the first two odd numbers $1$ and $3$ together, i.e. we add $3$ more boxes to our first box, and we will colour them in white to clearly demonstrate what I mean. $$\begin{align} \blacksquare&\,\,\,\Box \\ \Box&\,\,\,\Box\end{align}$$ Notice that now we have a square, $$\boxed{\begin{align}\blacksquare&\,\,\,\Box \\ \Box&\,\,\,\Box \end{align}}$$ so the number of boxes in total is a square number. Since this square is a $2\times 2$ square, then our new squared number is $2^2 = 4$.
Continue this pattern by adding $5$ more boxes in such a way where we make a $3\times 3$ square, and you get that the number of boxes is a squared number $3^2 = 9$. This is where the above formula comes from, and proves the truth of your method of square-rooting a squared number.
Go here for a further understanding if you are not familiar with the formula, and if you are familiar with the formula, go here instead.
Nice discovery though :)