One theory is the Big Bang theory, in this theory the universe originated from an enormous explosion
At first, the Earth was very hot and volcanic. A solid crust formed as the planet cooled, and impacts from asteroids and other debris caused lots of craters. As the planet continued to cool, water filled the basins that had formed in the surface, creating oceans.