There are different ways of producing neutrons, but the one we will focus on here is spallation. Spallation occurs when a high power proton beam hits a heavy element target which releases neutrons.

The protons are produced in an ion source and accelerated by a linear accelerator which is a complicated machine. The protons are accelerated by radio frequency cavities that use electromagnetic fields to push the proton forwards towards the target.
Spallation is an umbrella term for the processes that happen when a proton with energies greater than 1 giga-electronvolt (GeV) hits the nucleus of atoms in the target. In reality, the protons do not hit the entire nucleus of the tungsten atom since at ESS the protons have an energy of 2 GeV, giving them a wavelength of 6x10-16 m. The size of a tungsten nucleus is larger, about 10-14 m, so the protons actually only hit some of the subatomic particles in the tungsten nucleus (protons and neutrons). When the protons hit particles in the nucleus, some of these particles are expelled from the nucleus. This leaves the tungsten atom excited and it will decay and release even more subatomic particles in the processes. The released protons and neutrons have energies in the range 20 mega-electronvolts (MeV) up to 2 GeV, however most of them will have an energy in the lower end of the range.