It’s down to the way they are formed. Basically, once gravity starts winning in the internal forces within a star, it collapses on itself. At that point, it’s made up of protons, neutrons and electrons, like most visible matter. However, if the star is large enough, the force from the gravity compresses the atoms so much that the protons and electrons get forced together. And the tl;dr version is that when this happens, their charge cancels out, and you get more neutrons.
It’s down to the way they are formed. Basically, once gravity starts winning in the internal forces within a star, it collapses on itself. At that point, it’s made up of protons, neutrons and electrons, like most visible matter. However, if the star is large enough, the force from the gravity compresses the atoms so much that the protons and electrons get forced together. And the tl;dr version is that when this happens, their charge cancels out, and you get more neutrons.