How do performance-enhancing drugs work?

A brief primer on doping, in light of the recent Olympic ban.