The mountain ranges form where two continental tectonic plates collide. When the collision appears the land starts to lift up and as the continents press each other, the mountains will become bigger, both in territory and height. These are also the places where we have appearance of earthquakes. Earthquakes are a common occurrence in these places because there's lots of pressure and changing structures and opening gaps below the surface, which trigger them to activate.
Volcanoes and mountain ranges are related because both of them can appear on places where there's mid-ocean ridges and subduction zones (when oceanic tectonic plate subducts bellow continental tectonic plate), and both of them appear because of the high pressure from the mantle and the magma that pushes towards the surface.