There are 4 hypotheses that are all nearly 50-70 yrs (and some conjectured ~200 years ago).
1) either the Earth was accreted from pieces with H2O (in hydrated minerals) and was able to retain the gaseous envelope during subsequent collisions + internal other heating 2) H2O was delivered at later stage (after accretion) by secondary collisions (via asteroids) 3) H2O was delivered (later) mainly by icy bodies from outer solar system (of that time) [comets]. 4)Any combination of the above.
So far, as the article also indicates, we are not really closer to know with much certainty which process dominated. I doubt we will ever be able to solve this immensely non-linear multi-parameter inverse problem (though the path is more important than the goal, so we should keep walking ..).