The phenomenon known as the earthquake is a "sudden slip on a fault, and the resulting ground shaking and radiated seismic energy caused by the slip" (USGS Earthequake Glossary). The edges of the tectonic plate boundaries create what are called faults. You may already be familiar with some of the more famous and active faults, like the San Andreas Fault that runs along the West coast of the United States. The plate boundaries are jagged, "sliding, shearing, or grinding past each other" (PlateTectonics.com) and easily become stuck along these fault lines. "Since the edges of the plates are rough, they get stuck while the rest of the plate keeps moving" (USGS). This causes a build-up of frictional energy, as the rest of the plate continues to move, putting stress on the plate boundary. When the plates suddenly become unstuck and slip past each other, that stored potential energy is released, causing a huge jolt that manifests itself in varying degrees of destruction to the man-made infrastructure above the crust.
[USGS Earthquake Glossary: