As the Earth cooled following its formation, outgassing from volcanic activity released water vapor and other gases into the atmosphere. When the Earth’s surface cooled sufficiently, this water vapor condensed and fell as rain, filling the basins that would become oceans.
