The outer electron on aluminium is removed from the 3p sub-level, whereas the outer electron on magnesium is removed from the 3s sub-level.The 3p sub-level is higher in energy than the 3s sub-level.Aluminium's outer electron is further away from the nucleus and less attracted to the nucleus.This means less energy is needed to remove the electron from aluminium.