Cosmogony — Cosmogony is the study of the origins of celestial objects. It is most commonly used to refer to the study of the origin of the solar system.
Currently, the most widely accepted theory is that the solar system was formed roughly 5 billion years ago with the collapse of a nebula of gas and dust, likely caused by shock waves generated by a nearby supernova.
The solar system would have formed as a member of a star cluster, now long-since dispersed throughout the Milky Way over the course of the solar system’s orbits around it.
In the center of the collapsing gas and dust was the protostar which would eventually become the Sun, and a large accretion disk of gas and dust orbiting its equator would eventually give rise to the planets as particles of dust within it coalesced into planetesimals which began accreting more material on their own.
Recent models suggest that the large gas giant planets of our solar system may have formed rapidly, over the course of only a few million years. Other models suggest that the orbits of large gas giants would have spiralled inward until they were adsorbed by the central protostar, their orbital momentum sapped by the gas and dust of the star’s accretion disk; many generations of planets may thus form in the early solar system, with only the last ones remaining in orbit as the accretion disk thins.
Once the protostar became large and hot enough for nuclear fusion to ignite in its core, it enters a brief T Tauri phase in which it generates an extremely powerful solar wind that drives away any remaining gas and dust that has not been incorporated into planetary bodies.