How would you explain the fact that first ionisation enthalpy of sodium is lower than that of magnesium but its second ionisation enthalpy is higher than that of magnesium?

Electronic configuration of Na=1s2 2s22p63s1


Electronic configuration of Mg=1s2 2s22p63s2


After losing one electron sodium attains stable configuration that is why its first ionisation enthalpy is less than that of magnesium. But in case of second ionisation enthalpy magnesium has one electron in its outermost shell and to attain stability it loses that easily as compared to sodium which is already stable.


1