Put very roughly, we can boil this down to why aluminum and sulfur are depressed with respect to the average of the surrounding elements.
Aluminum is $\ce{[Ne]{3}s^2{3}p^1}$. Its first ionization removes the $3p$ electron while leaving the more stable $3s$ orbital intact, whereas magnesium has to break its more stable $3s$ orbital. So by comparison, the first ionization energy of aluminum drops off.
This does not mean aluminum will form ionic compounds more readily than magnesium. Despite aluminum's subshell advantage, both elements have first ionization energies that are too high to be offset by the electron affinity of a nonmetallic element and electrostatic attraction between the resulting ions. There is the possibility of retaining metal-metal bonding between +1 ions, which has become fairly well-known with magnesium, but ordinarily a reasonably low second or third ionization energy is needed to get a favorable energy balance with these elements. So to form ionic compounds aluminum ultimately has to give up its $3s$ electrons, which are more tightly bound than magnesium's, and thereby the subshell difference is obscured. Magnesium ultimately wins when it comes to ionic compound formation.
Turning now to sulfur, that element has the ground state configuration $\ce{[Ne]{3}s^2{3}p^4}$. In this case loss of an electron gives a half-filled $3p$ subshell with all the electrons unpaired and having identical spins. This stabilizes the half-subshell configuration through a quantum-mechanical exchange interaction between the electrons with like spin and total angular momentum. Sulfur forms this favored configuration when it ionized once, while phosphorus has to break it, and so the first ionization energy of sulfur (but again, not second or higher ionization energies) is depressed as we saw with aluminum. Note that the effect here is less than that involving full or empty subshells that we saw with aluminum versus magnesium.