Origin of water on Earth

The origin of water on Earth is only barely known. All life on Earth needs water, and most types of life started in the sea. Earth is the only planet known with liquid water on its surface. The water on Earth may have come from the Solar System as it formed, or it may have formed on Earth. Both are possible. We do know that hydrogen and oxygen, the elements that constitute water come from stars. Oxygen is created through fusion of helium and carbon atoms inside the core of red giants.
Earth is in the habitable zone, it is not so far from the Sun that all water freezes, and not so close to the Sun that all water evaporates. This is why liquid water, important for all life, still exists on the surface of Earth. 
A long time ago, scientists thought that water on Earth did not come from the planet’s region of the protoplanetary disk. Instead, it was thought water must have been delivered to Earth from the outer Solar System later in its history. However, recent research suggests that hydrogen inside the Earth played a role in the formation of the ocean. The two ideas are not mutually exclusive: there is evidence water was delivered to Earth by impacts from icy planetesimals similar in composition to asteroids in the outer edges of the asteroid belt.
One problem that hasn't been solved is that the noble gas isotope ratios of Earth's atmosphere are different than those of its mantle. This might mean they were created from different sources.