Exposure compensation allows you to offset your expsoure for corrective or artistic purposes. It allows you to force your camera to either underexpose or overexpose your photos by a certain amount of your choice.
For example, if you were shooting all day outside with bright snow on the ground, the ground will tend to turn gray if you trust your meter. So, you could force your camera to overexpose enough to compensate for the snow conditions (getting back to having white snow) and leave that setting for all of your pictures, rather than having to manually adjust for each photo you take.
Exposure compensation is used when you have your camera set on an auto (full program, portrait, landscape, sports, etc...) or semi-auto (aperture priority or shutter priority) exposure mode. You are telling the camera how much you would like it to under or overexpose.