There are four types of earthquake faults, which are differentiated by the relative position of the fault plane -- that is, the flat surface along which there's a slip during an earthquake.
In a normal fault (see animation below), the fault plane is nearly vertical. The hanging wall, the block of rock positioned above the plane, pushes down across the footwall, which is the block of rock below the plane. The footwall, in turn, pushes up against the hanging wall. These faults occur where the crust is being pulled apart, at a divergent plate boundary.
The fault plane in a reverse fault is also nearly vertical, but the hanging wall pushes up, and the footwall pushes down. This sort of fault forms where a plate is being compressed. A thrust fault moves the same way as a reverse fault, but at an angle of 45 degrees or less [source: USGS]. In these faults, which are also caused by compression, the rock of the hanging wall is actually pushed up on top of the footwall at a convergent plate boundary.
In a strike-slip fault, the blocks of rock move in opposite horizontal directions. These faults form when crust pieces slide along each other at a transform plate boundary. The San Andreas Fault in California is one example of a transform plate boundary.
With all these faults, rocks push together tightly, creating friction. If there's enough friction, they become locked, so that they won't slide anymore. Meanwhile, the Earth's forces continue to push against them, increasing the pressure and pent-up energy. If the pressure builds up enough, it will overcome the friction, the lock will give way suddenly, and the rocks will snap forward. To put it another way, as the tectonic forces push on the "locked" blocks, potential energy builds. When the plates are finally moved, this built-up energy becomes kinetic.
The sudden, intense shifts along already formed faults are the main sources of earthquakes. Most earthquakes occur around plate boundaries because this is where strain from plate movements is felt most intensely, creating fault zones, groups of interconnected faults. In a fault zone, the release of kinetic energy at one fault may increase the stress -- the potential energy -- in a nearby fault, leading to other earthquakes. That's one reason why several earthquakes may occur in an area in a short period of time.
These additional quakes are called foreshocks and aftershocks. The quake with the largest magnitude is called the mainshock; any quakes that occur before the mainshock are called foreshocks, and any quakes that occur after the mainshock are called aftershocks. Most of the time, the worst aftershocks occur within the first 24 hours after the mainshock hits. Bigger earthquakes trigger more aftershocks with larger magnitudes.
In the next section, we'll talk about the waves of energy that earthquakes generate, and the effects that they cause.