Positively charged protons repel one another. They're able to be in such close proximity in the nucleus because the neutrons separate them. If there are not enough neutrons, the protons repulsion will be too much to keep the nucleus together. Too many neutrons, however, is also a problem. Protons and neutrons occupy energy levels in the nucleus, similar to the electrons surrounding it. As neutrons are added, they have to occupy higher energy levels. There's a point where the energy of the strong force is not enough to hold on to neutrons in these higher energy levels. If there are too many neutrons, the nuclide will undergo beta decay to change a neutron into a proton, balancing out the ratio. If there are too many protons, the nuclide will undergo positron emission or electron capture to change a proton into a neutron.
Work Step by Step
The strong force is one of the fundamental forces of physics and which nucleons (protons and neutrons) are attracted to one another. This force acts over very small distances which is why nuclei have to be so small.