Overview
Cosmology is the scientific study of the universe as a unified whole, from its earliest moments through its evolution to its ultimate fate.
The currently accepted cosmological model is the big bang.
In this picture, the expansion of the universe started in an intense explosion 13.8 billion years ago.
In this primordial fireball, the temperature exceeded one trillion K, and most of the energy was in the form of radiation.
As the expansion proceeded (accompanied by cooling), the role of the radiation diminished, and other physical processes dominated in turn.
Thus, after about three minutes, the temperature had dropped to the one-billion-K range, making it possible for nuclear reactions of protons to take place and produce nuclei of deuterium and helium. (At the higher temperatures that prevailed earlier, these nuclei would have been promptly disrupted by high-energy photons.) With further expansion, the time between nuclear collisions had increased and the proportion of deuterium and helium nuclei had stabilized.
After a few hundred thousand years, the temperature must have dropped sufficiently for electrons to remain attached to nuclei to constitute atoms.
Galaxies are thought to have begun forming after a few million years, but this stage is very poorly understood.
Star formation probably started much later, after at least a billion years, and the process continues today.