Before the universe as we know it came into existence, all matter and energy is believed to have started out in an infinitesimally small point. For reasons yet unknown, this point exploded approximately 13.7 billion years ago in a cataclysmic event known as the big bang, after which the universe started to expand.
In the first moments of its existence, the universe was so dense and hot that it consisted entirely of energy, but already within seconds it had cooled enough for atoms of the lightest element – hydrogen (H) – to form. During the following minutes, new atomic nuclei of other light elements such as helium (He) were formed through the collision and fusion of hydrogen atoms, which is referred to as big bang nucleosynthesis. This process continued until the universe was approximately 5 minutes old, when it had expanded so much that atomic collisions became increasingly rare. At this point in time, all matter was present in a plasma state consisting of atomic nuclei scattered in a dynamic ocean of electrons.
After a few hundred thousand years, temperatures decreased to a few thousand degrees and neutral atoms with a positively charged nucleus orbited by negatively charged electrons were formed. The appearance of chemical bonds between atoms of specific elements subsequently gave rise to the first molecules. Upon further expansion and cooling, atoms and molecules accumulated into clouds of gas called nebulae. The earliest nebulae consisted only of the lightest elements, including hydrogen (74 %), helium (25 %), and trace amounts of lithium (Li), beryllium (Be) and boron (B).
Book reference: Marshak, S. (2007). Earth: Portrait of a Planet: Third International Student Edition. WW Norton & Company.
Image: Timeline of the universe from the big bang until present-day. Credit: NASA/WMAP Science Team.