I get that it's because of the increase number of protons, but I still don't understand the concept. When you move left to right on a periodic table, the protons increase at the same rate as the electrons. In fact, the number of electrons end up being the same as the number of protons, no matter how far you are across a period (unless it's an ion).
So shouldn't the attractive force of the nucleus and the forces of electron-electron repulsion be cancelling out due to the equal number of protons and electrons in an atom? Or is it because protons have a greater force of attraction compared to the repulsion force between electrons?