I understand that squaring the difference between a given value and the mean, and then summing those numbers and dividing by the total population or sample set minus 1, will give us the answer. But I'm trying to get to the bottom of why squaring the differences magically gives us the result we're looking for? I tried searching for this online, and the best answer I got was something about Gauss discovering that squaring the differences helped him calculate locations of the stars... but that didn't actually explain why squaring works? Is there a reason? Or is it just that squaring was a solution Gauss (and others) learned would give them the answers they needed? In that way, is math like religion - no actual internal logic, just a system created to give us the answers we need?
This is a question none of my math teachers growing up could adequately answer. I'm hoping the internet will redeem them.
Thanks!