.
Actually, the comets all came from Earth, when the crust of the earth was ruptured during the Genesis 6 judgment.
That is why they orbit the Earth and the sun predictibly. (see Kepler)
No comets came from any where else? Water is made up of two of common elements why would there be plenty? Already found it on several of the moons of other planets. I be more surprise if we don’t find water even water from earth.
The moon is just one more layer of protection for the Earth from errant celestial bodies among which are comets. It would just make sense if it got hit now and then by them.