For neutrons, which are electrically neutral, there is no Coulomb repulsion keeping them away from the nucleus. As such, it's quite "easy" for neutrons to be absorbed into a nucleus*, which is why neutron radiation tends to make materials radioactive - the neutrons are absorbed into the nuclei of the material, which convert into a different, possibly-unstable isotope. So the argument presented only applies in cases where both nuclear fragments/nucleons are positively charged (meaning that neither of them are free neutrons, since there are currently no confirmed bound multi-neutron systems).
In that case, the basic answer, with some caveats, is that the kinetic energy of the colliding bodies brings them close enough together to make the attractive nuclear force** significant.
In collisions like this, the two objects start with some initial kinetic energy, far enough away from each other to be considered "at infinity" as far as the electric fields are concerned. At the point of closest approach, the two objects have no kinetic energy (in the center-of-mass frame), so pretty much all*** of the kinetic energy initially possessed by the objects is now converted into electric potential energy $U=\frac{kq_1q_2}{r}$. A higher potential energy corresponds to a smaller separation between the two (repelling) objects, and a higher initial kinetic energy corresponds to a higher final potential energy. Therefore, the higher the initial kinetic energy, the smaller the final separation of the two objects. Get them close enough together, and the attractive nuclear force takes over.
For example, we can do this calculation with two protons. Let's assume that they collide head-on$^\dagger$, and that they need to be separated by at most 1 fm for the attractive nuclear force to take over. We can then equate the sum of the kinetic energies to the Coulomb potential energies $2K=\frac{ke^2}{r}$. Plugging in the aforementioned values, we require $K=719$ keV. Dividing this by Boltzmann's constant $k_B$ gives an associated temperature of 8.3 billion Kelvin! This is obviously much too high a temperature for even the cores of stars, so this should be puzzling.
The solution to this puzzle is twofold: first, we have to realize that the associated temperature we have derived is assuming that the average kinetic energy$^{\dagger\dagger}$ of an ensemble of protons is above the threshold for fusion. This is not necessary for fusion to, for example, power the Sun; fusion releases enough energy that even a relatively low rate of fusion would be sufficient to counteract gravitational collapse. A gas of protons at a lower temperature will still have a sparse, very high-energy "tail" due to the way the Maxwell-Boltzmann distribution works, so as long as there is a sufficient "tail," fusion can be found in ensembles of much lower temperature.
However, when the comparisons are made between the Sun's temperature and the required fusion rate, we still come up short. This is when it was realized that protons are not classical particles. In particular, the distances involved with fusion are of the same scale as those involved with quantum tunneling! It turns out that the proton can occasionally "tunnel through" the highest part of the Coulomb barrier, significantly lowering the average energy required for fusion and finally giving figures that agree with observations.
So the real answer is that nucleosynthesis happens when there are 1) nucleons in a dense enough concentration to ensure frequent collisions, and 2) high enough average temperatures that the high-energy tail of the Maxwell-Boltzmann distribution can tunnel through the Coulomb barrier. Generally, you see these conditions in the cores of stars and in the early universe. It's no coincidence that these are the places where nucleosynthesis is observed to happen.
*The word "easy" is in quotes here because, in general, it's still relatively rare for this to happen at most energies. This is because, though there is nothing preventing an on-target neutron from entering the nucleus, the nucleus itself is still a very small target when compared to the rest of the atom. As such, you need a high density of incident neutrons, or a high density of target nuclei, for this to occur with any regularity at most energies (there is an exception to this - some isotopes have a neutron capture resonance at a particular energy which essentially makes the nucleus seem much bigger than it actually is, and thus makes neutron capture much more likely than it would otherwise be). These conditions generally only occur in the cores of stars, in nuclear reactors, and in the early universe, which is where most nucleosynthesis happens, so this makes sense.
**I refer to the force holding the nucleus together as the "attractive nuclear force" to differentiate it from the force that holds quarks together inside the nucleons, which is the strong nuclear force. It is true that the strong nuclear force is ultimately responsible for the interactions that generate the attractive nuclear force, but the attractive nuclear force is best seen as an emergent residue of the strong nuclear force, and behaves quite differently from its more fundamental counterpart.
***The electromagnetic field carries away some energy due to the accelerating charges, but at the energies we're talking about this is a very small correction and can be ignored for our purposes.
$^\dagger$If they don't collide head-on, the required kinetic energy will be higher, but generally not more than a factor of 10 higher unless the situation is quite extreme, so this is not a terrible assumption to make.
$^{\dagger\dagger}$Well, average to within a factor of 2 or 3, anyway.