The 1st ionization enthalpy of magnesium is higher than that of Na due to higher nuclear charge and slightly smaller atomic radius of Mg than Na. After the loss of first electron, Na+ formed has the electronic configuration of neon (2,8). The higher stability of the completely filled noble gas configuration leads to very high second ionization enthalpy for sodium. On the ther hand, Mg+ formed after losing first electron still has one more electron in its outermost (3 s) orbital. As a result, the second ionization enthalpy of magnesium is much smaller than that of sodium.