These plates have been moving very slowly for billions of years, driven by energy called convection currents deep within the earth. It is this movement that has shaped the physical features of the earth such as mountains, valleys, plains and plateaus. Earthquakes occur when these moving plates grind and scrape against each other. When movement occurs along a fault, the motion we feel is the result of several kinds of seismic waves. Seismic waves are divided into body waves and surface waves.
Surface waves occur on the outer layer of the crust and body waves occur deeper.
P waves and S waves are body waves. P waves travel the fastest and hit first. These wave move up and down with vibrations that are perpendicular to the direction that the wave is traveling and cause a structure to vibrate from side to side. These arrive last, causing low-frequency vibrations. R and L waves are more likely than P and S waves to cause tall buildings to vibrate.