Many of the several million earthquakes that happen in the world every year go undetected because they are in remote areas or have tiny magnitudes. Of those that are detected, most are large tectonic earthquakes, which are caused by geological forces on rocks and the adjoining plates of the Earth's crust.
TL;DR (Too Long; Didn't Read)
Most earthquakes are tectonic earthquakes, which happen when the large, thin plates of the Earth's crust and upper mantle become stuck as they move past one another. They lock together, and pressure builds up. When they finally release, earthquakes occur.
Tectonic earthquakes occur at plate tectonic boundaries. Tectonic plates are constantly moving slowly, but sometimes friction between them causes them lock together and become unable to move. The rest of the plates carry on moving, which leads to increased pressure on the locked section. Eventually, the locked section succumbs to the pressure, and the plates move past each other rapidly. This movement causes a tectonic earthquake. The waves of released energy move through the Earth's crust and cause the shaking we feel at an earthquake site.
Plate Tectonic Boundaries
A tectonic earthquake occurs where tectonic plates meet, an area known as the boundary. When two plates push into each other, they form a convergent plate boundary. For example, the oceanic Nazca Plate off the coast of South America along the Peru-Chile trench pushes into and is subducted under the South American Plate. This movement lifts up the South American Plate, creating the Andes mountains. The Nazca Plate breaks into smaller parts that are locked in place for long periods before suddenly shifting to cause earthquakes.
A divergent boundary occurs when two plates pull away from each other, creating new crust, such as the Mid-Atlantic Ridge, which extends from the Arctic Ocean to beyond the southern tip of Africa. Over millions of years, it has caused plate movement of thousands of kilometers.
A transform boundary occurs when plates slide horizontally past each another, neither destroying nor producing crust. The plate movement makes zigzag plate margins and produces shallow earthquakes. The ocean floor is home to most transform faults, but some – such as the San Andreas fault zone in California – occur on land.
Faults and Fault Lines
A fault is a three-dimensional surface where blocks of rock have broken. The rock located on one side of the fault moves past the rock on the other side. A fault line stretches along the ground where the fault cuts the Earth's surface. Faults come in all sizes and are found everywhere in the world. During an earthquake, the rock on one side of the fault suddenly slips relative to the other side – horizontally, vertically or at any angle in between.
A normal fault forms when the block above the fault moves downward relative to the block below. A reverse (thrust) fault forms when the upper block moves up and over the lower block. A strike-slip (transcurrent) fault forms when two blocks slide past one another in a horizontal direction that parallels the fault line. It may be a left-lateral strike-slip fault when the displacement of the far block is to the left when viewed from the side. A right-lateral strike-slip fault occurs when the displacement of the far block is to the right when viewed from the side.
Other Types of Earthquakes
In addition to tectonic earthquakes, there are volcanic earthquakes, collapse earthquakes and explosion earthquakes. A volcanic earthquake is typically much smaller than a tectonic earthquake and results from tectonic forces that occur in conjunction with volcanic activity. A collapse earthquake is a small earthquake in underground caverns and mines that is caused by seismic waves produced by an explosion of rock on the Earth's surface. An explosion earthquake is caused by the detonation of a nuclear or chemical device.