In the beginning when the sun was formed about 5000 million years ago, it was surrounded by a disk-shaped cloud of leftover gases. As the time passed, the outer part of the cloud lost its head, space and cooled. The cold gases shrank under the attraction of gravity to form knots of condensed matter, called planetesimals.These planetesimals were constantly colliding with one another, shattering and then reassembling.

In this way, the small planetesimals gradually assembled into planets. During the formation of planets, many large sized objects were hurled randomly. These objects collided with the newly formed planets and satellites. The presence of craters on the surface of the Moon is the evidence of the initial chaos in the solar system.