The earth has four major layers: the inner core, outer core, mantle and crust.
The crust and the top of the mantle make up a thin skin on the surface of our planet. But this skin is not all in one piece -- it is made up of many pieces like a puzzle covering the surface of the earth.
Not only that, but these puzzle pieces keep slowly moving around, sliding past one another and bumping into each other. We call these puzzle pieces tectonic plates, and the edges of the plates are called the plate boundaries.
The plate boundaries are made up of many faults, and most of the earthquakes around the world occur on these faults. Since the edges of the plates are rough, they get stuck while the rest of the plate keeps moving.
Finally, when the plate has moved far enough, the edges unstick on one of the faults and there is an earthquake.