Answer :
It along plate margins. Where plates collide, run along side each other or if one subducts under another, If it gets caught/jammed, over time pressure builds and eventually it gives way, BOOM! The pressure is released as an earthquake. I guess inside the earth, the mantle is included but not hugely. Plates subducting might may cause friction to build up and cause the rock to melt and/or when it subducts into the mantle. But as it does, the pressure builds up again which will in tern cause a volcanic eruption.