The bends (just one possible form of decompression illness) are caused when gas that is dissolved in the body comes out of solution due to reduced pressure on the body, and forms gas bubbles in various body tissues.
Any material that can absorb gas will accumulate some of whatever gas it comes in contact with. Just as the oceans have oxygen and other gases dissolved in the water, our bodies also have some gases dissolved in them from breathing the air. The air is 21% oxygen and 79% nitrogen (plus small amounts of other gases). Since our bodies metabolize oxygen it doesn't accumulate in significant amounts, but nitrogen (and other breathing gases, such as helium) can.
The most commonly affected tissues are the skin, blood, brain, and around the joints. Joint pain accounts for the origin of the name "bends". This can happen to divers when the pressure decreases as they ascend towards the surface, and can also happen to those who are exposed to the low pressures found at high altitudes, such as astronauts. Reducing pressure on the body must be done at a controlled rate that accounts for how much gas is dissolved in the body and how much the pressure changes.