Why does ionization energy increase going down a group but decrease going across a period?
Ionisation energy increases across a period because the number of protons increase. This means that there is an increase in nuclear charge so there'll be more attraction.
While there is more attraction, one should know that distance from nucleus and shielding effect remains reasonably constant. This is because all the valence electrons are in the same principle quantum shell.
So the increase in nuclear charge,increases attraction and makes it the removal of an electron require more energy, while distance from nucleus and shielding effect remains reasonably constant.
There are however some exceptions across every period where the ionization energy drops between an atom of group 2 and group 3 (like Mg and Al) and between group 5 and group 6 (like P and S). Here the first drop is due to a slight increase in distance from nucleus as outer electron occupies a new subshell (p subshell) slightly further away from the nucleus. The second drop is due to spin pair repulsion which is due to the presence of 2 electrons in the same p orbital. This makes it require less energy to remove.
Now why does it decrease down a group?
Well, even though there's a noticeable increase in nuclear charge, there's even an increase in distance from nucleus and in shielding effect. This is clear because when you descend down a group, a new principal quantum shell is occupied by valence electrons. This increase in distance from nucleus and shielding effect, outweigh the increase in nuclear charge.