While backpressure is mostly correct, there's a little more to it than that.
Offroad bike racers found that by cutting off their exhaust pipes, they could get more power out of their engines in different power ranges. This idea evolved into the "tuned pipes" of today.
Because of the way two stroke engines work, a great deal of fuel would ordinarily slosh out unburnt if not for the effect of scavenging, a combination of backpressure and sound waves in sync with the engine that returns unburnt fuel to the combustion chamber.
There are a great many studies and documentation (even on the web

) into tuned pipe theory and it was discuvered it was not only the alteration of backpressure that enhanced an engine's performance, but more importantly the
sound waves eminated by the engine and how they are echoed back to the engine through the tuned pipe. To really work correctly, a tuned pipe's sound waves must be in sync with the engine; the length must be adjusted, and every engine will act differently with every pipe.
This is why you'll seldom see me comment in most "what's the best pipe" threads. You can't tell without being there, you have to hear and observe, as well as hear and observer the stock manufacturer recommended pipe for a baseline comparison.
There used to be a cool applet out there, but it's since dissappeared.
Here's a great one-pager on tuned pipe theory.