I think the short answer is we don't really know, but the simplest explanation is muddy icy comets colliding
How many comets have hit us that were rife with water supplies to provide the amount of water earth has given that water isn't also abundant on planets that are much larger, like Jupiter?
Why do we see planets with atmospheres of say sulfer, and earth doesn't have an issue with sulfer in the atmosphere?
Most of the comets whose orbit intersects with Earth's orbit collided eons ago.
Some comets still enter the inner Solar System, of course, but it's going to be extremely rare for one to be on the right path to hit the Earth.