Actually, there are two very different algorithms in Adobe Photoshop CS3 or later.
The old one just shifts linearly the color of a pixel. The second one works proportionally. If your intent is to understand, in general, how contrast is applied, use the legacy contrast only. Here's an image showing a difference:
When using legacy contrast, you see that it's much more intuitive from developers point of view. It actually lightens the dark pixels, and darkens the light ones when reducing the contrast. When increasing the contrast, you will see the same happening with gray color (turning lighter, then white at 100%), while blank and white staying the same.
From the point of view of photographers, on the other hand, this doesn't make any sense. As you can see below, when applied to real images, the new contrast algorithm has much better visual results than the old one: