The majority of naturally-occurring earthquakes are caused by movements of the earth's plates.
The basic theory is that the surface layer of the earth -- the lithosphere -- is comprised of many plates that slide over the lubricating athenosphere layer. At the boundaries between these huge plates of soil and rock, three different things can happen:
Plates can move apart - If two plates are moving apart from each other, hot, molten rock flows up from the layers of mantle below the lithosphere. This magma comes out on the surface (mostly at the bottom of the ocean), where it is called lava. As the lava cools, it hardens to form new lithosphere material, filling in the gap. This is called a divergent plate boundary.
Plates can push together - If the two plates are moving toward each other, one plate typically pushes under the other one. This subducting plate sinks into the lower mantle layers, where it melts. At some boundaries where two plates meet, neither plate is in a position to subduct under the other, so they both push against each other to form mountains. The lines where plates push toward each other are called convergent plate boundaries.
Plates slide against each other - At other boundaries, plates simply slide by each other -- one moves north and one moves south, for example. While the plates don't drift directly into each other at these transform boundaries, they are pushed tightly together. A great deal of tension builds at the boundary.