The origin of water on Earth, or the reason that there is clearly more liquid water on Earth than on the other rocky planets of the Solar System, is not completely understood. There exist numerous more or less mutually compatible hypotheses as to how water may have accumulated on Earth's surface over the past 4.5 billion years in sufficient quantity to form oceans.
Comets, trans-Neptunian objects or water-rich meteoroids (protoplanets) from the outer reaches of the asteroid belt colliding with Earth may have brought water to the world's oceans. Measurements of the ratio of the hydrogen isotopes deuterium and protium point to asteroids, since similar percentage impurities in carbon-rich chondrites were found in oceanic water, whereas previous measurement of the isotopes' concentrations in comets and trans-Neptunian objects correspond only slightly to water on Earth.
Planetesimals heated by the decay of aluminium. This could cause water to rise to the surface. Recent studies suggest that water with similar deuterium-to-hydrogen ratio was already available at the time of Earth's formation, as evidenced in ancient "eucrites" meteorites originating from the asteroid Vesta.
That Earth's water originated purely from comets is implausible, since a result of measurements of the isotope ratios of deuterium to protium (D/H ratio) in the four comets Halley, Hyakutake, Hale-Bopp, and 67P/Churyumov–Gerasimenko, by researchers such as David Jewitt, is approximately double that of oceanic water. What is however unclear is whether these comets are representative of those from the Kuiper Belt. According to Alessandro Morbidelli, the largest part of today's water comes from protoplanets formed in the outer asteroid belt that plunged towards Earth, as indicated by the D/H proportions in carbon-rich chondrites. The water in carbon-rich chondrites point to a similar D/H ratio as oceanic water. Nevertheless, mechanisms have been proposed to suggest that the D/H-ratio of oceanic water may have increased significantly throughout Earth's history. Such a proposal is consistent with the possibility that a significant amount of the water on Earth was already present during the planet's early evolution.
Recent measurements of the chemical composition of Moon rocks suggest that Earth was born with its water already present. Investigating lunar samples carried to Earth by the Apollo 15 and 17 missions found a deuterium-to-hydrogen ratio that matched the isotopic ratio in carbonaceous chondrites. The ratio is also similar to that found in water on Earth. The findings suggest a common source of water for both objects. This supports a theory that Jupiter temporarily migrated into the inner Solar System, destabilizing the orbits of water-rich carbonaceous chondrites. As a result, some of the bodies could have fallen inwards and become part of the raw material for making Earth and its neighbors. The discovery of water vapor out-gassing from Ceres provides related information on water-ice content of the asteroid belt.
Explanation from: https://en.wikipedia.org/wiki/Origin_of_water_on_Earth