Ionization enthalpy depends on which electron is being pulled off — and how stable the configuration left behind is. Look at where the electron comes from in each step, for both atoms.
Write out the electron configurations first.
\[\text{Na (Z = 11): } 1s^2\,2s^2\,2p^6\,3s^1
\]
\[\text{Mg (Z = 12): } 1s^2\,2s^2\,2p^6\,3s^2
\]
Step $\displaystyle 1$ — why the first ionization enthalpy, \(\displaystyle \Delta_i H_1 \), of Na is lower than that of MgIn sodium, the electron being removed is the lone \(\displaystyle 3s^1 \) electron. Taking it off leaves \(\displaystyle \text{Na}^+ : 1s^2\,2s^2\,2p^6 \), which is the extremely stable, fully-filled noble-gas configuration of neon. Because the atom is "trying" to reach that stable arrangement anyway, this electron comes off easily, so \(\displaystyle \Delta_i H_1(\text{Na}) \) is low ($\displaystyle 496$ kJ mol⁻¹).
In magnesium, the electron being removed comes out of a
filled subshell, \(\displaystyle 3s^2 \). A filled \(\displaystyle s \)-subshell has extra stability (both electrons pair up symmetrically), and on top of that Mg has one more proton in its nucleus than Na (Z = $\displaystyle 12$ vs Z = $\displaystyle 11$) while the shielding from the inner core is essentially the same. That means the effective nuclear charge \(\displaystyle Z_{\text{eff}} \) felt by the \(\displaystyle 3s \) electrons is higher in Mg. Both effects — greater \(\displaystyle Z_{\text{eff}} \) and the stability of a filled subshell — pull the electron in more tightly, so \(\displaystyle \Delta_i H_1(\text{Mg}) \) is higher ($\displaystyle 737$ kJ mol⁻¹).
This is the point people trip on: it is tempting to say "Mg is to the right of Na, so of course it's harder to ionize," treating it as a blanket periodic-trend statement. The real reason is the
specific configuration each atom is left with — Na empties a subshell to reach a noble-gas core; Mg has to break open a filled one.
Step $\displaystyle 2$ — why the second ionization enthalpy, \(\displaystyle \Delta_i H_2 \), of Na is higher than that of MgNow look at what is being removed in the
second step, i.e., from the +$\displaystyle 1$ ions.
\[\text{Na}^+ : 1s^2\,2s^2\,2p^6 \quad (\text{already a stable noble-gas core, like Ne})
\]
\[\text{Mg}^+ : 1s^2\,2s^2\,2p^6\,3s^1 \quad (\text{still has one electron left in } 3s)
\]
To form \(\displaystyle \text{Na}^{2+} \), an electron must be pulled out of the complete, tightly-held \(\displaystyle 2p^6 \) inner shell of \(\displaystyle \text{Na}^+ \) — a shell that is already a stable closed octet held by a nucleus of $\displaystyle 11$ protons acting on far fewer, more contracted electrons. Breaking into that shell costs a huge amount of energy, so \(\displaystyle \Delta_i H_2(\text{Na}) \) is very high ($\displaystyle 4562$ kJ mol⁻¹) — in fact almost ten times \(\displaystyle \Delta_i H_1(\text{Na}) \).
To form \(\displaystyle \text{Mg}^{2+} \), the electron removed is the single, loosely-held \(\displaystyle 3s^1 \) electron of \(\displaystyle \text{Mg}^+ \) — exactly the same kind of easy removal Na underwent in
its first step, since it leaves behind the same stable Ne-like core, \(\displaystyle 1s^2\,2s^2\,2p^6 \). So \(\displaystyle \Delta_i H_2(\text{Mg}) \) is comparatively modest ($\displaystyle 1450$ kJ mol⁻¹).
Since \(\displaystyle 4562 \text{ kJ mol}^{-1} > 1450 \text{ kJ mol}^{-1} \), the second ionization enthalpy of Na is higher than that of Mg — the reverse of the order in the first step.
**Answer: Na's first ionization enthalpy is lower than Mg's because Na loses its single outer \(\displaystyle 3s^1\) electron (attaining a stable Ne core), while Mg must remove one electron from a filled, more tightly-held \(\displaystyle 3s^2\) subshell (higher \(\displaystyle Z_{\text{eff}}\), extra stability of the filled subshell). Na's second ionization enthalpy is higher than Mg's because at that stage Na⁺ already has the stable noble-gas configuration \(\displaystyle 1s^2 2s^2 2p^6\), so removing a further electron means breaking into a complete inner shell, whereas Mg⁺ still has one loosely-held \(\displaystyle 3s^1\) electron left to lose easily to reach the same stable configuration.