Shock absorbers (sometimes called just "dampers", "struts", or "shocks") are a part of the suspension system, and use both gas pressure, fluid, and narrow passageways to resist both compression and decompression. In doing this, they also reduce spring bounce, which would be much more noticable without any shock absorbers to cancel it out or reduce the effect.
Most shock absorbers are a long tube with fluid inside, and when housed within a spring, that is considered either a strut or coil-over design. The usual method is to just mount the shock absorber wherever there is space available for it, and far from the pivot point on the chassis.
The spring has very little slowing its rebound, so it depends greatly on the shock absorber's extention resistance to reduce the rebound speed. If the resistance to extending is too strong, however, it will be too slow, which will reduce steering response and reduce the ability of the suspension to absorb bumps properly.
Since the springs are better at the compression stage of cornering or going over bumps, dampers tend to have a weaker compression rate than their extention rate. Having this setting too strong will give the ride a stiff, low-quality feel, and make the wheels more likely to lose contact with the driving surface. The compression rate being too weak, however, would force the strut to absorb most of the shock during the extention, which would slow the wheel's return to the driving surface after a bump has occured.
Struts are shock absorbers that also serve as part of the steering and suspension system. They rotate with the steering knuckle as the wheels are turned for steering. Because of this, the top portion sits in a strut mount and has a bearing that allows the top portion to rotate.
Assembling a Strut
Because of how integral the strut is to the framework of the suspension, strut assemblies are their own units that can be pulled out and disassembled off of the vehicle. The video above demonstrates how a semi-typical strut is assembled. All parts shown are common to most vehicles except the strut mount for this application has an unconventional design.