Although not all earthquakes are caused by sudden slip along a fault, most of them are. The general concept you must keep in mind is that faults are relatively planar (flat) fractures in the crust along which rocks on either side of the fault move in different directions. Because fault surfaces are “rough”, rocks that meet along a fault do not slide freely past each other, but are instead locked for long periods by friction along the fault. Over decades to millenia, strain builds up within the rocks that are separated by the fault as their movement is prevented by along-fault friction. At some point, the amount of strain exceeds the frictional forces that are preventing slip. The fault ruptures and rocks on either side of the fault slide rapidly as the pent-up strain is relieved. The moment of rupture is when the earthquake occurs. For obvious reasons, the earthquake cycle is frequently referred to as a “stick-slip” process - long periods of “stick” are followed by a short period of “slip”, and the process then repeats itself.