Octahedral Crystal Field Splitting Orbital Degeneracy
It is because perfect octahedral symmetry is normally assumed; the two $\mathrm{e_g}$ levels and three $\mathrm{t_{2g}}$  are degenerate.  If there was a distortion, say by lengthening both $z$-axis ligand positions then the $\mathrm{e_g}$ degeneracy would be removed as the $\mathrm d_{z^2}$ becomes more stable than $\mathrm d_{x^2-y^2}$. This happens because the $z$-axis ligand has more effect on $\mathrm d_{z^2}$ than on $\mathrm d_{x^2-y^2}$ orbitals simply due to its position. The $\mathrm d_{xy}$ orbital also increases in energy removing the degeneracy of the $\mathrm{t_{2g}}$ and the  $\mathrm d_{yz},$ $\mathrm d_{zx}$ lowered.