Hot magma rises from the mantle at mid-ocean ridges pushing the plates apart. Earthquakes occur along the fractures that appear as the plates move apart.
At subduction zones, the oceanic plate is pushed down, or subducted, below the continental lithosphere. As the oceanic slab decends, earthquakes are generated within the slab and at the interface between the plates.
Continental collisions result in the creation of mountains and fold belts as the rocks are forced upwards.
Where two plates slide past each other, earthquakes originate at shallow depths. California is a good example of this type of boundary.