Earth and the other planets formed about 4.6 billion years ago. They were made of the leftover gas from the nebula that made the Sun. The Moon may have been formed after a collision between the early Earth and a smaller planet (sometimes called "Theia"). Scientists believe that parts of both planets broke off — becoming (by gravity) the Moon.