Horizontal trends
Increasing nuclear charge is accompanied by respectively more electrons in neutral atoms. In the periodic table, Moving from left to right the increase of nuclear charge has an influence that usually outweighs the screening from additional electrons. The Increasing Zeff leads to an increase of IE across every period, which is the most significant single trend in the periodic table. Simultaneously, the atoms become smaller.
As demonstrated for the elements Li-Ne in diagram 1. The IE trend across a period is not completely regular. Irregularities can be identified from the electron configurations involved. Ionization of boron eliminates an electron from a 2p orbital, which is less tightly bound than 2s involved in beryllium and lithium. So the IE of B is a little less than that of Be. Between the oxygen and nitrogen, the issues involved in Hund's rule are significant. Up to three 2p electrons can be accommodated in dissimilar orbitals with parallel spin so as to minimize their mutual repulsion. For O (2p)4 and consequent elements in the period some electrons are paired and repel more strongly, leading to the IE values less than would be supposed by extrapolation from the preceding three elements.
The trends displayed in diagram. 1 is sometimes cited as proof for a 'special stability' of filled and half-filled shells. This is a confusing notion. The common increase of IE across a period is completely caused by the increase of nuclear charge.
Maxima within the plot at filled shells (2s)2 and half-filled shells (2p)3 take place only due to the decrease after these points.
It is the exclusion principle that controls this type of details by forcing the next electron either to occupy another orbital type (as in boron) or to pair up giving a doubly occupied orbital (as in oxygen).