So the Earth has four major layers. The crust, mantle, inner and outer core. Since the crust is not whole, its made pieces and these pieces move around slowly and because these plates move around and are rough they get stuck and the force between them and the plates rub and rub together and break loose which is the absolute earthquake. And above you can see that the plates are moving around. This is called a fault where plates move against each other and causes an earthquake to happen. And the same is pretty much the same only underwater. So we hope this helped you learn more about earthquakes and be sure to check out our other pages!
Here is a video that explains the major basics and shows examples of some brutal earthquake damage. I hope that all this information helps.