The ocean was made by comets. When comets hit the earth, it added more and more water to the surface. When the Solar System was being made, not a single trace of water was found on Earth. There were comets all over the Solar System. So of course, comets would end up hitting the earth.
A comet has ice in it. When a comet gets closer to the atmosphere, it heats up and the ice turns into water. Whenever the comet strikes the earth, it bursts and water is added.