(CNN) Earth didn't exactly start out ready to support life, but scientists now have a better idea of how the essential elements for life ended up on our planet, according to a study published Wednesday in the journal Science Advances.

Something had to deliver the vast majority of carbon, nitrogen, sulfur, hydrogen and other elements, known as volatiles, to Earth because the rocky planets in the solar system lacked these essential ingredients for life.

"But the timing and mechanism of volatile delivery has been hotly debated," said Rajdeep Dasgupta, co-author of the new study and professor in Rice University's Department of Earth, Environmental and Planetary Sciences, in a statement. "Ours is the first scenario that can explain the timing and delivery in a way that is consistent with all of the geochemical evidence."

The researchers believe that these volatile elements were delivered when a Mars-size planet collided with Earth 4.4 billion years ago. This collision also created our moon.

Though this has been a longstanding theory, others have argued that a collision actually created the elements or that the volatiles were delivered after the moon-forming collision. To test these scenarios, Dasgupta and his team ran high-temperature, high-pressure experiments, thermodynamic modeling and numerical simulations.

Read More