The basic idea is that a neutron all by itself has a lower energy state available to it, which is to decay into a proton, an electron, and an antineutrino. On the other hand, in the nucleus of a stable atom, a neutron decaying would result in a higher energy state for the whole nucleus.
Does that help?