Water formed on the surface of the Earth, according to current scientific theory, long after the inner worlds of the solar system developed. Current thinking must be regarded as only a stage in our certain understanding of how our world developed.
However, this is what is thought: our world was originally dry, the surface then becoming molten as result of collisions. Later collisions with wet comets and asteroids led to water forming on the surface of Earth.