The Ground Beneath Our Feet
The Earth feels solid and unmoving, so when the ground suddenly shakes during an earthquake, it can be both surprising and frightening. Earthquakes have shaped landscapes and affected human life throughout history. But an earthquake is not random or mysterious. It is the result of slow, powerful forces working deep within the Earth, and understanding it starts with what the planet's outer shell is actually made of.
Earth's Cracked Shell
The outer layer of the Earth, called the crust, is not a single solid piece. Instead, it is broken into many large slabs known as tectonic plates. These plates fit together a bit like the pieces of a giant cracked shell covering the planet. Beneath them, the hot, slowly flowing rock of the Earth's interior keeps the plates in constant, very slow motion. The plates drift only a few centimeters each year, about as fast as fingernails grow, but they are always moving.
Stuck Plates and Building Pressure
The boundaries where these plates meet are called faults. As the plates try to move past one another, they often get stuck along these faults because of friction. The plates do not stop moving overall, so as the stuck section holds, stress and pressure build up along the fault, year after year. The rock is being strained and bent, storing up an enormous amount of energy, like a spring being slowly wound tighter and tighter.
The Sudden Release
Eventually, the building stress becomes too great for the friction to hold. The fault suddenly gives way, and the stuck sections of crust lurch past each other in a quick, violent movement. All the energy that was stored over years is released in an instant. This energy spreads outward through the ground as waves, called seismic waves, and it is these waves that we feel as the shaking of an earthquake. Most earthquakes happen near the edges of tectonic plates, which is why some regions of the world experience them far more often than others.
Source
This article was written using information from Wikipedia.