A nucleus is stable if it does not decay of its own accord into another nucleus.
A nucleus is unstable if its neutron-proton ratio is less than 1:1 or greater than 1.5:1.
At close distances, a strong nuclear force exists between nucleons. This attractive force comes from the neutrons. More protons in the nucleus need more neutrons to bind the nucleus together.
As the nucleus gets bigger, the protons are further apart. The electrostatic repulsions between the protons get weaker. The nuclear strong operates over such short distances that it weakens even faster than the repulsions. After a certain size, it can no longer hold the nucleus together.
Adding extra neutrons increases the space between the protons. This decreasess their repulsions but, if there are too many neutrons, many of them must be in high-energy states. This makes the nucleus less stable and it decays.