A nucleus with too many neutrons gets more stable by one of the neutrons turning into a proton, and giving off a beta. It’s like changing the shape of one of the blocks.