P waves, or primary waves, are the fastest moving waves and the first to be recorded by a seismograph. As P waves travel through solid rock, they cause particles to move back and forth in the same direction the wave is traveling - much as the wave moves down the slinky below. P waves can travel through solids and liquids, such as water or magma.
S waves, or secondary waves, are seismic waves that arrive after the P waves. They travel slower than the P waves. S waves can travel through solids but not through liquids. These waves cause the rock particles to move up and down, much like the waves shown in the rope below.