It’s due to the tectonic plates shifting. The shift in the plates causes volcanos to form and when the plates shift it causes earth quakes. I’m not a scientist I’m just trying to remember what I learned in science. Hopefully that helps. I would honestly just gone tectonic platesearth quales and volcanos.