Group two elements have ionization energies that are greater than those of group one.
As a general trend, ionization energy increases as you move up and to the right of the periodic table.
For periods one and two, both hold electrons in the same orbital level, the s level. However, group two elements have more protons than group one elements (For example Magnesium has one more proton than sodium), and thus electrons have a higher force of attraction to group two elements.
For an explanation on how electron shells work, I would suggest this video from Khan academy which does an excellent job in explaining it: https://www.khanacademy.org/science/biology/chemistry--of-life/electron-shells-and-orbitals/v/orbitals.