Volcanoes are caused when molten rock from within the mantle breaks through the crust and flows out over the surface. But volcanoes don't occur everywhere.
Volcanoes form in two places on the Earth.
The Earth's crust is made up of a series of plates. When these plates collide, one can be forced below the other. As this happens it is pushed into the hotter mantle and starts to melt. The melting rocks rise back up through the mantle and start working their way into the crust. Some will get trapped and cool slowly.