The gases that make up Earth's atmosphere came from a swarm of comets, not from bubbling volcanoes as long thought, a new study says.