The fact is explained by electronic configuration and stability of the ions formed.

Key idea

  • Sodium: \ce{Na}:1s^2,2s^2,2p^6,3s^1
  • Magnesium: \ce{Mg}:1s^2,2s^2,2p^6,3s^2

Why first ionization of Na is lower

  • In both Na and Mg, the first electron is removed from the 3s orbital.
  • However, Mg has a higher effective nuclear charge and slightly smaller atomic radius than Na, so it holds its 3s electrons more strongly, making its first ionization enthalpy higher than Na’s.

In simple words, the single 3s electron of Na is more loosely held than one of the two 3s electrons of Mg, so it needs less energy to remove.

Why second ionization of Na is higher

  • After losing one electron:
    • \ce{Na+}:1s^2,2s^2,2p^6 (noble-gas configuration, very stable)
* \ce{Mg+}:1s^2\,2s^2\,2p^6\,3s^1 (still has one 3s electron left)
  • The second ionization of Na would have to remove an electron from the stable, completely filled neon-like core of \ce{Na+}, which needs a lot of energy.
  • For Mg, the second ionization just removes the remaining 3s electron from \ce{Mg+}, which is less stable than a noble-gas core, so the energy needed is comparatively lower than for \ce{Na+}.

So:

  • First ionization: I_1(\text{Na})<I_1(\text{Mg}) because Na’s outer 3s electron is more weakly held.
  • Second ionization: I_2(\text{Na})>I_2(\text{Mg}) because \ce{Na+} already has a noble-gas configuration, making further electron removal very difficult.

Do you want a one-line exam-style answer you can directly write, or a diagrammatic explanation comparing the energy levels?