Magmatism
Magmatism is the placing of magma within and on the surface of the outer layers of a terrestrial planet, where it cools and hardens into igneous rocks. It happens through magmatic activity or igneous activity. This includes making magma, moving it into rock (intrusion), and pushing it out (extrusion) as magma or lava. Volcanism is the part of magmatism that we can see at the surface.
Magmatism is one of the main processes that build mountains. The kind of magmatism that happens depends on the tectonic setting. For example, andesitic magmatism is linked to the making of island arcs at convergent plate boundaries. Basaltic magmatism is found at mid-ocean ridges, where the sea floor spreads apart at divergent plate boundaries (sea-floor spreading).
On Earth, magma forms when rocks made of silicate partly melt. This is called partial melting. It can happen in the mantle, the continental crust, or the oceanic crust. We can find evidence of magmatic activity in igneous rocks that formed from magma.
Convergent boundaries
Magma is linked to every stage of convergent plate boundaries, where plates move toward each other. This includes the start of subduction, when one plate sinks beneath another. When oceanic crust sinks, water released from it usually causes partial melting of the asthenosphere above. Magma is missing only when the sinking plate does not go deep enough, as in the earliest stages, or during flat-slab subduction, which squeezes out the asthenosphere. The magma is mostly calc-alkaline and forms a curved magmatic arc. Only the volcanoes of modern arcs can be seen at the surface, so scientists study the magma chambers underground using geophysical methods. In old arcs on continental crust, erosion has often exposed the deep rocks that formed from the same magma as the volcanoes.
When continents collide, the crust becomes much thicker. This heats the crust and causes anatexis, which is melting within the crust. This usually forms granite rock that is peraluminous. After a collision, magma can form through decompression melting. This is linked to isostatic rebound and possibly to the thick crust stretching and collapsing. Slab detachment has also been proposed as a cause of magma forming late in or after a collision.
Divergent boundaries
New crust that forms at divergent boundaries on the ocean floor is almost entirely made of magma. Mid-ocean ridges are places where magma rises and forms new rock almost all the time. The basalts that erupt there are tholeiitic in character. They form when hot, soft rock from deeper down rises and partly melts. Mid-Ocean Ridge Basalts (MORB) look quite similar all over the world because they come from a mostly uniform source.
Back-arc extension often creates new ocean crust and spreading centres. These usually last only a short time. The hot rock behind the arc has been partly affected by gases and water from the sinking plate. So back-arc basin basalts are somewhere between MORB and Island Arc Basalts (IAB).
Intraplate
Magma activity away from the edges of tectonic plates is an important part of magmatism on Earth. It includes the largest known magmatic events, called Large igneous provinces. Hotspots are places where hot rock from deep inside the Earth rises, possibly through mantle plumes, and partly melts the rock above it. Hotspots can build underwater seamounts or islands that rise above the sea. For short periods of time, hotspots stay in about the same place, so scientists can use them to measure how tectonic plates move. As a plate moves over a hotspot, volcanoes form in a line, such as the Hawaiian–Emperor seamount chain. Under continents, hot magma melts the rock of the continental crust and can form a rock called rhyolite. The Yellowstone hotspot is an example of this.
Many continental rift zones also have magmatism. This happens because the lithosphere becomes thinner, and hot rock rises and melts. This magmatism is often bimodal, which means it produces two different kinds of rock.
Main article: Large igneous province

Quiz time!
4 questions about Magmatism
What is magmatism?
Keep exploring
This article is a child-friendly adaptation of the Wikipedia article on Magmatism, available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.