Volcanism is the eruption of material from deep in the Earth. In many cases, eruptions build up a pile of material, a mountain that is called a volcano. But here I'll discuss volcanism, because most eruptions don't build volcanoes. This is a highly simplified treatment of an intricate subject.
Four Types of Magmatic Volcanism
The majority of Earth's volcanism happens underwater at the mid-ocean ridges, or, in plate-tectonic language, at divergent margins. The crust is pulled apart, and the hot rock in the mantle beneath begins to melt as the pressure upon it is released. The part that meltsthe magmarises while the rest of the mantle rock stays behind. The two parts have different compositions: the magma is basalt and what remains is peridotite, a heavier rock that is largely olivine.
This kind of volcanism is mostly a quiet oozing of basalt lava out of long cracks in the seafloor. Seafloor fissure eruptions have been filmed from research submarines, forming pillow lava. There are a few divergent margins on land, and volcanism there is very different from the oceanic case (including Oldoinyo Lengai, the world's weirdest volcano).
The second type of volcanism happens in association with subduction zones (that is, convergent margins), places where oceanic plates laden with water and sediment plunge into the hot mantle. It is responsible for building most of the world's volcanoes. Fluids that are driven off the descending plates rise into the upper, overriding plate where they promote the formation of magma. Notice that in this case magma is created by adding water to mantle rock, not by releasing pressure on it.
Subduction-created magma rises into the lower crust, where it collects and occasionally erupts vigorously, even explosively (see the eight-point Volcanic Explosivity Index or VEI). The geometry of subduction means that volcanoes tend to appear in long arcs (see more on arc volcanism).
The third type of volcanism covers the small fraction of volcanoes, about 10 percent, in places that aren't related to divergent or convergent margins. These are lumped together as hotspot volcanoes. There are two schools of thought about hotspots. The majority of geologists consider hotspots to arise from very deep in the mantle, in rising plumes of hot material. A minority has a newer theory involving fracturing of the lithospheric plates, in which magmas form much as they do in divergent settings (see more on these hotspot alternatives).
The fourth type is not occurring today, but has happened in recent geologic history. It is flood volcanism, in which enormous amounts of basalt lava pour out of fissures and cover areas of thousands of square kilometers. Flood basalts appear both on land (for example the Columbia River Basalts and the Deccan Traps) and under the sea (the Ontong Java Plateau, Kerguelen Plateau, and more). These are under intense study but remain a major unsolved problem in geology.
Products of Volcanism
Volcanism recycles the material that goes through plate tectonics. To a first approximation, everything that is subducted returns to the surface in magma. When magma is eruptedthat is, when magma becomes lavait returns solids, fluids and gases to the Earth's crust and surface.
The solids are igneous rocks, ready to enter the rock cycle. They may be flows of lava that cool into thick layers of hard rock, or shattered fragments of volcanic ash. Either way, the minerals of igneous rocks become available to turn into sedimentary and metamorphic rocks (learn more about the three great rock classes).
The fluids act underground. As they rise magmas release water, which incorporates with it dissolved silica, metals and other elements in a chemically active mix. These magmatic fluids can alter the rocks around them and deposit bodies of ore and sulfate minerals.
The gases are what cause lava to erupt. Just as bubbles form in an opened can of soft drink, so do sulfur gases, carbon dioxide, and water vapor in rising magma. The result is that rising magma expands, and this in turn makes it rise faster. The volcanic gases enter the atmosphere, where they influence its composition and affect the global climate in various ways.
There are less well-known types of volcanism that don't involve magma: mud volcanism is one. Mud volcanoes come in two types. On land, hundreds of them occur in areas where hydrocarbons are abundant, like Trinidad or Azerbaijan (see this example). Under the sea, thousands of them occur near subduction trenches, where serpentinite mud is abundant (about serpentinization).
Another newly discovered form of volcanism involves asphalt. Asphalt flows were first documented on the floor of the Gulf of Mexico in 2003. No one knows how many of these tar volcanoes there are.