The Big Bang is thought to be the origin of the hydrogen (including all deuterium) and helium in the universe. Hydrogen and helium together account for 98% of the mass of ordinary matter in the universe, while the other 2% makes up everything else. The Big Bang also produced small amounts of lithium, beryllium and perhaps boron. More lithium, beryllium and boron were produced later, in a natural nuclear reaction, cosmic ray spallation.
Stellar nucleosynthesis is responsible for all of the other elements occurring naturally in the universe as stable isotopes and primordial nuclide, from carbon to uranium. These occurred after the Big Bang, during star formation. Some lighter elements from carbon to iron were formed in stars and released into space by asymptotic giant branch (AGB) stars. These are a type of red giant that "puffs" off its outer atmosphere, containing some elements from carbon to nickel and iron. Nuclides with mass number greater than 64 are predominantly produced by neutron capture processes—the s-process and r-process–in supernova explosions and neutron star mergers.
The Solar System is thought to have condensed approximately 4.6 billion years before the present, from a cloud of hydrogen and helium containing heavier elements in dust grains formed previously by a large number of such stars. These grains contained the heavier elements formed by transmutation earlier in the history of the universe.
All of these natural processes of transmutation in stars are continuing today, in our own galaxy and in others. Stars fuse hydrogen and helium into heavier and heavier elements (up to iron), producing energy. For example, the observed light curves of supernova stars such as SN 1987A show them blasting large amounts (comparable to the mass of Earth) of radioactive nickel and cobalt into space. However, little of this material reaches Earth. Most natural transmutation on the Earth today is mediated by cosmic rays (such as production of carbon-14) and by the radioactive decay of radioactive primordial nuclides left over from the initial formation of the Solar System (such as potassium-40, uranium and thorium), plus the radioactive decay of products of these nuclides (radium, radon, polonium, etc.). See decay chain.