You asked HOW it is that the bonded neutron is stable, but the free neutron is not: 'What happens inside the nucleus that makes neutrons stable?'
This is an ontological question and these are the hardest to answer. The best answer you can get in terms of conventional physics is differences in binding energy, as Lagerbaer explained. The Table of Nuclides gives empirical evidence THAT binding energy is strongly associated with nuclide stability (but interestingly is not perfectly so). However, that still does not answer the HOW & WHY questions. WHY do those energy differences exist?
If you have a curious mind, you will find other explanations of this effect, but these are less orthodox. Our own explanation is here and is given in terms of a hidden-variable solution
http://vixra.org/abs/1111.0023
An extract from the ABSTRACT reads:
Findings - The stability of the neutron inside the nucleus is found to arise from the formation of a complementary bound state with the proton. The neutron is an intermediary between the protons, as the discrete forces of the protons are otherwise incompatible. This bond also gives a full complement of discrete forces to the neutron, hence its stability within the nucleus. The instability of the free neutron arises because its own discrete field structures are incomplete. Consequently, it is vulnerable to external perturbation.
The paper goes on to explain how this is proposed to operate, in terms of ordered structural interactions between nucleons (nuclear polymer). We would emphasize that this explanation is unorthodox. Nonetheless it does have a broader usefulness since the same mechanics are able to explain the related and even more difficult problem of why any one nuclide (not just the neutron on its own) is stable/unstable/non-existent for the range Hydrogen to Neon (at least) http://dx.doi.org/10.5539/apr.v5n6p145
So the deeper question is why the free neutron (n) is unstable, why 1H1 is stable, but 1H2 is unstable (but has a longer life than n), and 1H3 is wildly unstable? We think we can explain all that, and all the others all the way to at least Neon. This region of the table of nuclides is otherwise notoriously difficult to explain.
So maybe that explanation for the stability/instability of the neutron is not so crazy after all.