The Solar System appears stable and orderly. The planets move in nearly circular orbits, mostly within the same plane, and all revolve around the Sun in the same direction. This structure is not accidental. It reflects the way the system formed.
The starting point is not a collection of planets, but a cloud.
The Solar System began as a large, diffuse cloud of gas and dust. This material was not pristine. It already contained heavier elements such as carbon, oxygen, silicon, and iron, produced in earlier generations of stars and dispersed into space through stellar winds and supernova explosions. The cloud from which the Solar System formed therefore carried the chemical imprint of a long prior history.
At the same time, the cloud consisted overwhelmingly of hydrogen and helium. As the collapse began, all components moved inward together under gravity, so there was no initial separation between light and heavy elements. The reason the Sun ended up containing most of the hydrogen and helium is simply that the central region accumulated most of the total mass.
Under the influence of gravity, the cloud contracted. As it shrank, its density increased and the inward pull strengthened. Even a small initial rotation became important during this process. As the size of the cloud decreased, the rotation sped up, and the collapsing material flattened into a rotating disk. This is the key step: the Solar System formed not as a sphere, but as a disk.
Most of the mass gathered at the center of this disk, where density and temperature became high enough for nuclear reactions to begin. That central region became the Sun.
The remaining material stayed in the disk, orbiting the Sun. Within this disk, small particles began to collide and stick together. Dust grains formed larger aggregates, which in turn formed larger bodies. Over time, this process built up objects of increasing size.
It is at this stage, not during the initial collapse, that the composition of planets begins to differ. Close to the Sun, temperatures were high, and the growing bodies were too small to retain light gases such as hydrogen and helium. At higher temperatures these gases move more rapidly, and the weak gravity of the forming objects is not sufficient to hold onto them, so they escape rather than being incorporated. Only heavier elements could remain and accumulate, leading to the formation of rocky planets.
Farther from the Sun, where temperatures were lower, larger bodies could form more easily. Once they became sufficiently massive, they were able to gravitationally capture hydrogen and helium from the surrounding disk. This led to the formation of gas giants and icy bodies in the outer regions.
The disk did not remain forever. Radiation from the young Sun, along with stellar winds and other processes, gradually dispersed the remaining gas. What was left behind was a system of planets, smaller bodies, and debris, all orbiting the central star.
The structure we observe today still carries the imprint of this origin. The planets lie approximately in a common plane because they formed in a disk. They move in the same direction because the disk rotated as a whole. Their compositions vary with distance from the Sun because temperature and gravitational retention varied across the disk.
In that sense, the Solar System is not an arbitrary arrangement. It is the natural outcome of gravitational collapse, rotation, and gradual accumulation.
What now looks like a stable system of planets began as a cloud. The order we see today is the result of that evolution.
See also: What is a star?
How stars forged heavy elements
How did structure form in the universe?