Scientists may have figured out an important part of the process that allows habitable rocky planets to form. New research suggests that when giant asteroids or other rocky bodies collide in space, they sometimes produce a powerful shockwave, forming the crystals that make up some of the material of rocky planets like Earth.

Scientists figured this out by zapping a material called frosterite with a laser. Frosterite is a mixture of magnesium, silicon and oxygen, and it's commonly found on rocky planets. According to Space.com, Earth's upper mantle is about 70% to 80% frosterite, Space.com reported.

When the frosterite in the lab reached a certain pressure, the scientists discovered it would generate crystals made up of material like magnesium oxide.

Pyrope/Wikimedia Commons

The research is helping scientists better understand the composition of rocky planets.

"Our results provide a better understanding how impact-generated magmas evolve and allow us to model Earth-type planets' inner structures," Toshimori Sekine, lead author on the new study, said in a statement. "Collisions at these extreme temperatures and pressures created our own Earth and may have also formed the mantles of other Super Earth planets, for example CoRoT-7b and Kepler-10b."

Sekine and his team thinks the frosterite crystals could help generate the magnetic field that envelopes our planet and protects us from dangerous space radiation.

"Our results can support the possibility that violent, large-scale collisions between space bodies containing enough forsterite and moving faster than about 13 kilometers per second (8.1 miles per second) could lead to chemical layering in the mantels of massive terrestrial planets," Sekine said in the statement. "Melting forsterite may have produced a sufficiently high concentration of magnesium oxide in early Earth's core to power a magnetic field around the planet."