Another important source of gas that formed the secondary
atmospheres of the terrestrial planets was impacts by
comets. Huge numbers of comets formed in the outer parts
of the Solar System and were therefore rich in volatiles.
As the giant planets of the outer Solar System grew to maturity
or migrated their orbits, their gravitational perturbations
stirred up the entire population of icy planetesimals (comet
nuclei) that orbited within their domain. Many of these icy
bodies were flung outward by the giant planets to form the
part of the Solar System known as the Oort Cloud, and some
joined other existing planetesimals in the Kuiper Belt.