Someone else had asked this question but not to enough detail.
I understand that you can sum all of the elements from $1$ to $n^2$ that are in the matrix to get $n^2(n^2+1)/2$. Then from there you can divide by the number of rows, or n that is, to get that each row or column depending on how you look at it should equal $n(n^2+1)/2$.
My question is how does this prove that the diagonals should have this same sum? Or if it does not, how do I prove that?
The reason the diagonals have the same sum is that said property is part of the definition of a magic square.
If you just require, in a square grid, that the numbers in each column and in each row add up to the same sum, then the diagonals do not necessarily also add to that sum. Have a look at $$ \begin{array}{ccc} 7&6&2\\5&1&9\\3&8&4\end{array} $$