Not everything in the theory of planet formation is thought to be well understood today. Therefore, planetary science is a very exciting and topical research field. A well established (but still sketchy) scenario of planet formation shall be described in the following:
Wolken aus Gas und Staub als Ausgangsmaterial
Zwischen den Sternen, im interstellaren Raum, befinden sich Wolken aus Gas und Staub. Astronomen und Astronominnen nennen sie Nebel. Sie bestehen vor allem aus Wasserstoff und Helium und bilden das Ausgangsmaterial für neue Sterne und Planeten. Wenn ein Stern zerfällt, entsteht ebenfalls wieder ein Nebel. Mehr dazu ist unter zu lesen. Der nächste Nebel von der Erde aus ist der Helixnebel - er ist 700 Lichtjahre von uns entfernt und enstand beim Zerfall eines Sterns. In seinem Innern ist als Überbleibsel ein zu sehen.
A protoplanetary disk evolves:
Like any other star, the sun was born out of a giant gas cloud. The gas cloud collapsed under its own gravity. Out of the contracted matter, stars were finally built (see stellar evolution).
If the cloud was to rotate only slightly at first, the rotation would have increased during the contraction. This is because of a physical law which states that the angular momentum of a system is conserved. The effect is well known from figure skaters: While performing a pirouette, they first circle slowly with outstretched arms. When the arms are brought closer to the body, the rotation is significantly accelerated. The wider the difference between starting and end span, the greater the effect. You can try it for yourself on a swivel chair.
According to the same principle, the rotation of a contracting gas cloud is accelerated. The angular momentum of the cloud is transferred to a comparatively small star. Thus, the newborn sun rotates fast enough to allow particles to move outwards, following the centrifugal forces. The material ejection finally slows down the rotation speed of the sun, but now a disk of gas has been formed around the young star and perpendicular to its rotation axis; a protoplanetary disk.
From a dust grain to a planet:
Gradually, the protoplanetary disk cools down. Individual elements start to condense, the most heat-proofen ones nearby the sun, the more volatile ones only far outside. The chemical composition of the disk is therefore altered from the interior towards the outer parts.
Eventually, more and more of the condensed dust grains populate the protoplanetary disk. They concentrate to larger dust agglomerations (the same process can be observed under many sofas).
The dust balls clump together into bodies with cross sections of several kilometers, so-called planetesimals. Here, the planet’s blueprint does lack some details, since it is not yet clear how meter-long objects really can stick together.
The planetesimals grow further by means of continuous mutual collisions. Gravity holds them together, resulting finally in planet-size objects. Since the protoplanetary disk is thicker in its outer parts massive planets rather form in the outskirts than nearby the sun. After having reached a critical weight of around 10 earth masses the planets start to accrete gas from its surroundings and finally form gas giants.
From the above scenario one can roughly get a picture of the solar system like the one we observe today: Four small terrestrial planets in the inner parts, four large gas planets in the outer parts orbit the sun on almost circular paths and perpendicular to the axis of their host star.