The Earth formed around 4.5 billion years ago from a cloud of dust and gas that collapsed under gravity to form a spinning disk. As the disk spun and separated into rings, the particles at the center became molten and formed the Sun, while the outer particles cooled to form planets like Earth. The Moon is believed to have formed from debris ejected during a giant impact between Earth and a Mars-sized planet called Theia. Without the stabilizing effect of the Moon, Earth's rotation would have been faster and its climate more extreme, potentially preventing the emergence of life.