The r-process happens inside stars if the neutron flux density is so high that the atomic nucleus has no time to decay via beta emission between neutron captures. The mass number therefore rises by a large amount while the atomic number (i.e., the element) stays the same. When further neutron capture is no longer possible, the highly unstable nuclei decay via many β decays to beta-stable isotopes of higher-numbered elements.