Re: Water from comets or asteroids?
"Did the water on Earth occur as a part of planet building (and also other planets)? Or did the water need to come from someplace else?"
Water would have been fairly evenly distributed amongst the stuff from which the Solar System formed and it also seems probable that the inner planets were at least partially formed by the time that Sol ignited because the solar pressure from Sol, after its ignition, would have prevented or disrupted their formation. Thus, it seems likely that Earth, and the other inner planets, would have already possessed as much water as anything else in the solar system when and as they formed.
Furthermore, if Earth acquired water from asteroid and cometary impacts then the vast majority of this would have arrived during the Late Heavy Bombardment, from about 4.1 to 3.8 billion years ago, but the earliest zircons found indicate that Earth already had surface water about 4.4 billion years ago. And whilst the asteroid and cometary impacts during the LHB would have delivered water to Earth, the high-energy nature of those impacts would have meant that a quite a bit of that water in those asteroids and comets would have been turned to free vapour by the impact and lost to space.
It seems then, that the asteroid and cometary impacts would have delivered some of Earth's water but didn't supply the majority of it.