How compression pants work and why they are so popular

Lots of people wear compression gear when they run or workout at the gym, but are they actually doing anything for you?