The Earth’s oceans formed through a combination of processes, including the condensation of water vapor in the atmosphere, the delivery of water-rich comets, and the release of water vapor and other volatile compounds through volcanic activity.