"Shock Absorber" is a woefull misnomer, used only in the United States. A shock absorber does nothing to absorb shocks; that's what springs are for.
In places with more sense, this device is called a "hydraulic dampener". The purpose of a dampener is to absorb the energy from the springs, so when you hit a bump the car doesn't go bouncy-bouncy forever.
Here's how it works: you hit a bump, and the tire is forced to move up. The spring compresses, and absorbs the energy from the bump rather than passing it all along to the passenger cabin. Now, if you didn't have dampeners, what would happen?
That's right: the spring would forcefully expand again, lifting that corner of the car. Then it would compress, and expand, and compress, and expand, and you'd be going bouncy-bouncy, which is unpleasant in street driving and dangerous on a race track.
So the shock absorber, or dampener, resists the spring's desire to expand, translating that kinetic energy into thermal energy by forcing a piston through hydraulic fluid. The fluid offers resistance, and the result is that the dampener heats up and the spring expands more slowly, and only to it's "at rest" position. No bouncy-bouncy.
The exact same principles apply when the wheel is suddenly dropped, as into a pothole. The dampener basically resists any motion away from its center, and then regulates the speed at which the suspension travels back *to* the center.