Volcanism (or volcanicity) is the phenomenon of eruption of molten rock (magma) onto the surface of the Earth or a solid-surface planet or moon, where lava, pyroclastics and volcanic gases erupt through a break in the surface called a vent. It includes all phenomena resulting from and causing magma within the crust or mantle of the body, to rise through the crust and form volcanic rocks on the surface.
Magma from the mantle or lower crust rises through its crust towards the surface. If magma reaches the surface, its behavior depends on the viscosity of the molten constituent rock. Viscous (thick) magma produces volcanoes characterised by explosive eruptions, while non-viscous (runny) magma produce volcanoes characterised by effusive eruptions pouring large amounts of lava onto the surface.
In some cases, rising magma can cool and solidify without reaching the surface. Instead, the cooled and solidified igneous mass crystallises within the crust to form an igneous intrusion. As magma cools the chemicals in the crystals formed are effectively removed from the main mix of the magma (by a process known as fractional crystallization), so the chemical content of the remaining magma evolves as it solidifies slowly. Fresh unevolved magma injections can remobilise more evolved magmas, allowing eruptions from more viscous magmas.
Movement of molten rock in the mantle, caused by thermal convection currents, coupled with gravitational effects of changes on the earth's surface (erosion, deposition, even asteroid impact and patterns of post-glacial rebound) drive plate tectonic motion and ultimately volcanism.
Volcanoes are places where magma reaches the earth's surface. The type of volcano depends on the location of the eruption and the consistency of the magma.
Earthquakes are generally associated with plate tectonic activity, but some earthquakes are generated as a result of volcanic activity (though that itself is ultimately driven by the same forces).
When magma cools it solidifies and forms rocks. The type of rock formed depends on the chemical composition of the magma and how rapidly it cools. Magma that reaches the surface to become lava cools rapidly, resulting in rocks with small crystals such as basalt. Some of this magma may cool extremely rapidly and will form volcanic glass (rocks without crystals) such as obsidian. Magma trapped below ground in thin intrusions cools more slowly than exposed magma and produces rocks with medium-sized crystals. Magma that remains trapped in large quantities below ground cools most slowly resulting in rocks with larger crystals, such as granite and gabbro.
Existing rocks that come into contact with magma may be melted and assimilated into the magma. Other rocks adjacent to the magma may be altered by contact metamorphism or metasomatism as they are affected by the heat and escaping or externally-circulating hydrothermal fluids.
Volcanism is not confined only to Earth, but is thought to be found on any body having a solid crust and fluid mantle. Evidence of volcanism should still be found on any body that has had volcanism at some point in its history. Volcanoes have indeed been clearly observed on other bodies in the Solar System - on some, such as Mars, in the shape of mountains that are unmistakably old volcanoes (most notably Olympus Mons), but on Io actual ongoing eruptions have been observed. It can be surmised that volcanism exists on planets and moons of this type in other planetary systems as well. In 2014, scientists found 70 lava flows which formed on the Moon in the last 100 million years.