Suspension shocks give your off road bike improved handling as they absorb the trail shocks. Suspension now comes in many different types and sizes. For example, a cross country mountain biker may want a short travel shock offering 80mm of travel for smoother terrain at high speeds, and a downhill rider will require a longer travel shock often offering upwards of 8-10". This is for greater shock absorbency again at high speeds.
Another great feature that comes on some suspension units is the ability to 'lock out' the suspension shock and this helps preserve energy wasted by 'bobbing' on climbs or smoother terrain. The lock out can be positioned on the top of the shock itself on a flick lever or operated remotely by a lever on the handlebar meaning your hand needn't move from the bar to lock the rear shock out.
Rear shocks work in much the same way as a suspension fork. Some are air sprung and others coil sprung although on a rear shock the two can be combined. Rear suspension is only really found on mountain bikes in a big way. As with forks the rear suspension can provide anything from 60mm of travel up to 10" of travel for downhill bikes. Fox and Rockshox are market leaders for both types of suspension and are fitted on most new bikes.