Noble gas electron configuration is a full p orbital as the highest energy orbital, and it's called this because all noble gases possess it. This is the quality that makes them exceptionally stable. Group IA atoms, which have one electron in their highest energy s orbital, very easily lose that electron (become cations) to achieve that noble gas electron configuration.
The "goal," if we may call it that, is to achieve that noble gas electron configuration, which is just the electron configuration of the noble gas directly preceding (for metals) or after (for halogens) the element you're looking at. Metals lose electrons to achieve that electron configuration. Halogens and other elements on that side of the periodic table gain electrons to achieve that noble gas electron configuration.
For example, neon is a noble gas, with an electron configuration of 1s2 2s2 2p6.
Sodium has an electron configuration of 1s2 2s2 2p6 3s1. It very easily loses that 3s electron, resulting in the electron configuration of 1s2 2s2 2p6, just like neon. Now that it has the noble gas electron configuration, which is exceptionally stable, it's harder to remove more electrons because having that full p orbital makes the cation very stable. This means that the first ionization energy for sodium is small (we're just taking off that 3s1 electron) and the second ionization energy is quite large (the next electron we'd take off is from the full 2p6 orbital, and that's hard to do!).
Now look at magnesium. It has an electron configuration of 1s2 2s2 2p6 3s2. Taking off one electron will still be quite easy (although a bit harder than taking that one off from sodium). This would leave us with an electron configuration of 1s2 2s2 2p6 3s1. This is the same electron configuration as sodium! So taking off that second electron will also be easy, as we saw above, leaving us with a 1s2 2s2 2p6 electron configuration, which is the same as the electron configuration of neon, our noble gas. So in this case, taking off one electron is easy (1st ionization energy is low), and taking the second one off is easy too (2nd ionization energy is low too).