first off, as a general rule, the more negative the the element, the bigger its radius would be. since Mg 2+ is more positive than P it has a smaller radii. this means that the 12 electrons that would normally fill the Mg orbitals is now reduced to 10 electrons in its radius.
Also think about the effective nuclear charge as it explains alot of trends of periodic table. When mg2+ has 10e it has same number of protons which binds them more tightly hence smaller whereas in an anion number of electrons is increased and nuclear charge is less