There are three places a volcano can occur: at mid-ocean ridges, at subduction zones where a continental and ocean plate collide, and at a hot spot located in the middle of a plate. Mid-ocean ridges are caused by divergent tectonic plates and are the most volcanically active feature on earth.
Subduction zones occur when an oceanic plate and a continental plate collide, which causes the denser oceanic plate to slide underneath the lighter continental plate. When this happens, the crust in the oceanic plate is pulled deeper into the earth, where it eventually melts to form magma that eventually rises to the surface through the volcano. The "Pacific Ring of Fire" that stretches around the Pacific is home to the majority of the world's subduction zones, which is why it is also home to most of the land volcanoes on earth.
The third type of volcano occurs at a so-called hot spot, which is a thinner spot in the earth's crust where magma rises to the surface to form a volcano. Most volcanoes that result from hot spots have more gradual, less destructive eruptions. The Hawaiian Islands were formed by such a hot spot, with each separate island being formed over time as the oceanic plate slid over the top of the hot spot.