As expected, there's a lot of misinformation about what PED's do in this thread. People think taking ANY kind of PED is going to give you some kind magic powers that will put you leagues ahead of the competition. This isn't the case at all.
PED's range from non prescription, Non-Steroidal Anti-Inflammatory Drugs (NSAID's) such as Ibuprofen and other painkillers, all the way to Anabolics, Human Growth Hormone (HGH), Andro, and other "Steroids" both designer and non designer.
Typically when people talk about PED's, their referring specifically to Anabolics. Eg. Nandrolone, which is a banned substance in boxing and other athletics. To the point of your question - what do they do?
Anabolics have a variety effects, depending on how much you take, and what you take them with. Some of the effects can be increased red blood cell production (thereby increasing the amount of oxygen in your muscles via increased haemoglobin), increased lean muscle mass, reduce fat, and act as a diuretic. The latter, diuretics, help with cutting weight, and can also help mask other drugs that may be banned.
Taking any one of them on it's own, can't produce something like a harder punch. Nor can it make you move faster, think faster, be more agile, or any other Marvel superpower people claim steroids give.
What anabolics allow, is and increase of gains through hard work, which you would normally not achieve. For instance, a decreased recovery time from working out, will allow you to train more often, which will give you an edge over your competitor. The increase in lean muscle mass can help you move up in weight, but not lose much speed and keep, or even increase, your natural punching power, to that of the bigger man. Again, it's important to note here, that "steroids" do nothing without a strict training and diet regime. They aren't magic.
Lastly, typically if you're taking steroids, you'll be on a "stack". Meaning you'll be taking other drugs to help mask any side effects that may be present. For instance, when coming off of a cycle of testosterone, your body will not produce any more of it because it thinks it's producing too much already. To compensate, you will start producing more estrogen. So as the extra testoterone leaves your system, you will be producing high levels of estrogen. The result..."b!tch tits". So you'll need to take estrogen blockers to stop that from happenning. You may also be taking a Taurine supplement to aid proper growth of your new found lean muscle mass in skeletal muscles, or if you're taking steroids orally, to help reduce the cramping from the huge amounts of stress you're putting on your liver.
How does this all relate to sports and testing? Well, it's important to note that there is an acceptable amount allowed for these banned substances. This is because people produce/consume a certain amount of them. If you have exceed the allowed limit, then you are accused of doping. What's also important to know is when the testing is done, and what kind of testing there is. PED's become untraceable much sooner in urine, then they do in blood. So athletes take the steroids during the training, then stop taking them the closer the event comes.
So this effectively means that a good doper will not fail his/her drug test if they're savvy enough about the system. Random, frequent blood tests are the only way to ensure no drugs are being used.
Hope that helps.