Why does the observed pattern for first ionization energy within a period occurs?
The general trend for (first) ionization energy is that it increases from left to right across a period.
Why is this?
Going left to right, with each successive element you come across, it has one more proton and one more electron in the atoms, so the electric force experienced between the protons and electrons increases, and the electrons are consequently "pulled" in closer to the nucleus (decreasing size).
Note that metals, which are on the left side of the table with fewer valence electrons, tend to lose electrons to form cations. Nonmetals, on the right side of the table with more outer electrons, tend to gain electrons to form anions.
This general tendency of "gaining" an electron rather than "losing" one (or vice versa) is a result of the atom's ionization energy; for metals (left side), they have fewer electrons in the outer shell, so removing them will be easier (lower ionization energy), and for nonmetals (right side), removing an electron is harder because (a) it is smaller and has a larger concentration of charged particles in a more dense area, and (b) fulfilling octet is easier by simply gaining electrons; removing electrons from nonmetals is not very energetically favorable.
With all this in mind, it explains why ionization energy of an atom increases from left (metals) to right (nonmetals).