Earthquakes occur when the pressure that is built up between two tectonic plates is released making the two plates jolt.
Tectonic plates are large pieces of the earth's crust that float on top of hot magma. There are places where these massive plates meet and these are called fault lines or faults. Faults are found all over the world from the San Andres fault, to faults underwater and in Asia.
There are three main types of faults: transform, convergent and divergent. Every fault falls into one of these categories. Divergent faults are places where two plates are moving away from each other. When this happens it allows hot magma to seep through and fill this space so that the surface area of the earth is equal. This creates a large valley ranging form 30 to 60 kilometers wide. Divergent plates do not diverge much at all during the course of a year but over the course of many years these changes are not so subtle.
To give an idea of how much they move and intermediate moving plate moves about five to nine centimeters per year! Although five to nine centimeters does not sound like much, that is a lot in geological time. For something to be considered geologically young it is two hundred years old. That makes five to nine centimeters, one thousand to eighteen hundred centimeters (5*200=1000 9*200=1800).
Convergent faults are faults where two plates meet and collide. This sometimes causes one plate to go under another or sometimes causes the two plates to push up. When this happens: mountains, volcanoes, and most importantly earthquakes are made.
The third and final type of fault is the transform. A transform fault is where two plates are rubbing against each other and are sliding in opposite directions. An example of a transform fault is the San Andreas fault which is located along the western coastline of the U.S.A.