Shadow mapping is a quicker but less accurate way of calculating shadows than shadow volumes. Thus it is more suitable for real-time applications where resources are scarce. The hard edges that this produces can be softened by modifications to the base algorithm.
The basic steps used to create a shadow map are the following:
Render the scene from the light's point of view.
Save the scene's depth buffer as a depth map.
Draw the scene, comparing coordinates against the depth map.
Elements on the light side are drawn in light, and the rest are drawn in shadow.
Most of these steps can be done dynamically in the video card itself, with the depth map stored and updated in the video card's memory. For static shadows, this algorithm can be applied offline as well.