Volcanoes occur when magma from the earth's mantle reaches the surface. This can happen at the place where two tectonic plates diverge or converge. It can also occur in a place called a hotspot, in which magma from the mantle reaches the surface in the middle of a tectonic plate.
In places like the Mid-Atlantic ridge, volcanism occurs because the plates pull apart from each other, allowing magma to escape to the surface to form volcanoes. This is how new crust is formed and, in cases like Iceland, how new landmasses are formed.
In the Cascade Range of the western United States, two plates converge with one another, forcing one plate under the other plate. Areas like this are known as subduction zones. The plate going under is melted by the earth's mantle, which rises and forms volcanoes on the surface.
The different types of plate boundaries mixed with the composition of the crust and other factors lead to a large variety of volcanoes. Volcanic cones are the most recognizable of the volcanoes, but volcanoes can also form as relatively flat fissure vents. Volcanoes can be found in many parts of the world, both on land and beneath the sea, and even on other planets and moons.