First of all, Earth has a lot of water. It has 1,260,000,000,000,000,000,000 l of water. Some of this is in the oceans, some in the rivers and some inside Earth’s rocks, and some very deep inside Earth’s crust.
We think that the water we have today on Earth formed before the Earth was born, before the birth of the Sun 4.5 billion years ago, that is a very long long time ago, in space (a.k.a. the interstellar medium or for short ISM), where is very very cold.
Some of this water was brought on Earth by comets and asteroids that smashed into the early Earth, some of it was probably locked away in molten rock and later resurfaced.
Not just Earth has water but there is water on the Moon, on the planet and most the moons of the gas giants, Jupiter, Saturn, Uranus and Neptune have lots of water ice. Our Galaxy Is Soaked with Water-Rich Alien Planets. And where there is water, there is life, (they say).
“Our data indicate that about 35 percent of all known exoplanets which are bigger than Earth should be water-rich,” study leader Li Zeng, a postdoctoral fellow in the Department of Earth and Planetary Sciences at Harvard University, said in a statement. “It was a huge surprise to realize that there must be so many water worlds.” (space.com) If water does turn out to be a natural part of planetary birth, rather than due to a few lucky comet strikes, that increases the odds of life occurring elsewhere in the Universe, says Jonti Horner, an astrobiologist at the University of Southern Queensland in Toowoomba.