Magma Origination
The Earth's crust averages about 35 kilometers thick under the continents, but averages only some 7-10 kilometers beneath the oceans. The continental crust is composed primarily of sedimentary rocks resting on crystalline basement formed of a great variety of metamorphic and igneous rocks including granulite and granite. Oceanic crust is composed primarily of basalt and gabbro. Both continental and oceanic crust rest on peridotite of the mantle.
Rocks may melt in response to a decrease in pressure, to a change in composition such as an addition of water, to an increase in temperature, or to a combination of these processes.
Other mechanisms, such as melting from impact of a meteorite, are less important today, but impacts during accretion of the Earth led to extensive melting, and the outer several hundred kilometers of our early Earth probably was an ocean of magma. Impacts of large meteorites in last few hundred million years have been proposed as one mechanism responsible for the extensive basalt magmatism of several large igneous provinces.
Read more about this topic: Igneous Rock