At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
Both protons and neutrons are fermions, so no pair of protons, or pair of neutrons, can occupy the same state. There are, roughly speaking, two important variable components to a quantum state: the volume occupied by the particle and the kinetic energy of the particle. One state differs from another in at least one of these components. Therefore, to put two protons into the same volume of space (the space occupied by a nucleus) you must give them different kinetic energies: one higher, one lower If you start adding more and more protons to the same volume of space, you have to give each additional proton a larger and larger kinetic energy. Nor can you give it just any old additional amount of kinetic energy: you must increase it in certain specific-sized steps (quanta) that are determined by the nature of the force that confines the particles. This is very much like stacking electrons in an atom: to get more electrons into the same volume (the volume of the atom), you have to put them into states of higher and higher kinetic energy. (Indeed, you can construct a shell model for nuclei that is similar in many ways to the shell model of electrons in an atom.) The same is true for neutrons: to get more and more neutrons into the volume of the nucleusi, you have to increase the kinetic energy of each additional neutron. Now comes the crucial part: because protons and neutrons are DIFFERENT PARTICLES, they need NOT occupy different states. That is, you do NOT need to increase the kinetic energy of a proton to add it to the same volume of space occupied by a neutron, and vice versa. Now imagine building a nucleus. You put in 1 proton. Now you want to add another nucleon: if you add another proton, you have to give the new proton a higher kinetic energy. But you can add another neutron for free (without giving it a higher kinetic energy)! So adding a neutron will result in a lower total energy than adding a proton. This is why a deuteron (1p,1n) has a lower energy than an He-2 nucleus (2p) or a neutron pair (2n). Now you add another nucleon. Either a proton or neutron will have to go into a higher energy state, so it doesn't matter which you do, and we're at (2p,1n) or (1p,2n). But NOW when you come to add the fourth nucleon, you should definitely add whatever you didn't add for the third, to get you to (2p,2n). Because if instead you added the same, you'd have (3p,1n) or (1p,3n). In either case, you'd have to add the third proton or third neutron with much higher kinetic energy. You can keep going this way. Essentially, you build the lowest energy nucleus by alternating, very roughly, adding protons and neutrons, because that means you have to increase the kinetic energy only with every OTHER nucleon, instead of which every one. You end up with nuclei that are roughly half and half protons and neutrons. Nuclei that have more protons than neutrons, and those with more neutrons than protons, are both of higher energy and can decay to the more stable nuclei by changing a proton to a neutron (by emitting a beta+ particle) or a neutron into a proton (by emitting a beta- particle). This is very rough, of course, and there are many complicating factors that result in the ratio drifting away from 1:1 as you get to heavier nuclei, and give unusual stability to certain "magic" numbers. But the core of the issue is as above.