In mantle region of Earth's layer, molten rocks and metals are constantly moving by convection current. Hotter rock moves upward while cooler rocks moves downward. That creates pressure on Earth's crust. The pressure produced by convection currents of liquid rocks is enormous. It breaks the crust into sheet of rocks called Tectonic Plates. These plates' moves above the liquid rocks like leaves on the water. Sometimes one plate goes over other, sometimes one slides along another and that causes earthquake.
Friction stops plates from moving continuously that causes the stress to build up between plates. Sooner or later that stress is released by the sudden movement of plates triggering earthquake.
Last century earthquake killed over 2 million people. As the surface of earth is very solid, it tries to resist any change in its position. So when the change finally happens the result is very catastrophic.