A series of items caused the Earth to partially melt when being formed. First of all, the impact of asteroids and other debris heated the Earth. Some people even believe that these impacts caused the moon to form, as well. In addition, immense gravitational compression, the act of gravity smashing an object into a rounder, denser structure, caused the Earth to melt.