Simply put, it is down to the attraction between positive and negative particles. The protons within the nucleus of an atom make the nucleus 'positive'. In contrast, electrons are 'negative'. If you imagine two magnets of opposing charge, they will be attracted to one another. This is exactly the same principle for electrons and protons. Electrons stay within their orbit of a nuceus because of their attraction to the positive nucleus of the atom. As you go from left to right of the periodic table, the number of protons in the nucleus increases by 1 each time and the number of electrons also increases by 1. As the number of protons and electrons increase, the strength of the attraction between them also increases. Ionisation energy is the amount of energy required to remove an electron from its orbit. As you can imagine, the stronger the attraction between the nucleus and the electrons, the more difficult it will be to remove one of those electrons, and therefore the amount of energy required to remove the electron will increase. Thus, from left to right of the periodic table, ionisation energy increases. Additionally, ionisation energy changes down the periodic table. This is due to something called electron shielding. In basic terms, as you go down a period, you add an additional 'shell or shield' of electrons. As the number of electron shells increases, the distance between outermost electron and the nucleus increases and so the attraction between them decreases. This is also affected by the fact that electron repel one another. As you add additional shells of electrons, outermost electrons are repelled by more central electrons, and so do not 'feel' the full attractive force of the nucleus, again decreasing their attraction to the nucleus. This effect decreases ionisation energy down the periodic table.