The answer is Spontaneously
The subatomic particles were formed from the energy of the Big Bang explosion spontaneously by the continued chemical and physical reaction of the different substances present. Firstly, light elements such as hydrogen and helium were formed. Subsequently, through the process of Annihilation and Pair production spontaneous formation of photons; particle and anti-particle pairs ensued. This continued reaction results in a drop in temperature by 10 trillion degrees Kelvin that allowed for the formation of protons, neutrons, and electrons.