If you intersect your solid with the plane $z=\text{const}$ you will get the square
$$|x| \le \sqrt{a^2-z^2},\quad |y| \le \sqrt{a^2-z^2}$$
with area $A(z)=4(a^2-z^2)$. Imagine the solid being made up of "infinitesimally thin" slices of height $dz$. The volume of such a slice will then be
$$
dV = A(z)\,dz = 4(a^2-z^2)\,dz
$$
and the total volume will be
$$
V = \int_{-a}^a dV = \int_{-a}^a 4(a^2-z^2)\,dz
$$
since we have to let $z$ vary from $-a$ to $a$ in order to cover the entire solid.
If you intersect your solid with the plane $z=\text{const}$ you will get the square $$|x| \le \sqrt{a^2-z^2},\quad |y| \le \sqrt{a^2-z^2}$$ with area $A(z)=4(a^2-z^2)$. Imagine the solid being made up of "infinitesimally thin" slices of height $dz$. The volume of such a slice will then be $$ dV = A(z)\,dz = 4(a^2-z^2)\,dz $$ and the total volume will be $$ V = \int_{-a}^a dV = \int_{-a}^a 4(a^2-z^2)\,dz $$ since we have to let $z$ vary from $-a$ to $a$ in order to cover the entire solid.