The Earth’s surface was originally molten for many millions of years. Eventually, the Earth’s surface cooled and a thin crust formed, but volcanoes kept erupting, releasing gases inside the Earth. When things eventually calmed down, the early atmosphere was mostly carbon dioxide and water vapour. The water vapour condensed to form the oceans.