A very clear and concise explanation of the process of exhaust gas scavenging and how it's affected by exhaust size, length and cam timing.
The BasicsArticle from: http://autolounge.net/tech/exhaust.html
As are most things automotive, the exhaust system is a compromise. It must balance noise and performance. In addition, the exhaust system can be designed to increase performance in the low RPM range or at the top end. All of these aspects must be taken into account when designing the best possible setup for a given application. A larger pipe diameter typically will reduce backpressure allowing the engine to expend less energy pushing out exaust gas. If the system was being restricted, this will result in more power at a certain range of RPMs. The downside to larger pipes is a loss of power in other areas of the power band and increased noise.
Scavenging
At first glance one might think that a maximum pipe size would result in the best performance. It should provide the most flow. This is true for a steady stream of gas. An engine ejects exhaust gas out of the ports in pulses though. This results in a stop-go-stop-go situation as the exhaust valve opens and closes. A properly sized pipe will help to suck the gases out of the cylinder at certain RPMs. Since air has mass and velocity, it has momentum. When in the scavenging RPM, the exhaust charge exiting actually creates a vaccum for part of the exhaust stroke. This provides for a nice boost in power and torque. For ideal scavenging an exhaust speed of 240-260 feet per second is desired. Thus as engine speed increases for a given displacement so must the pipe diameter.
Below is a typical graph of exhaust port pressure vs. piston position:
NOTE: The exhaust pressure during scavenging nets out to be positive. Thus there is not an all around vaccum. Energy is still being wasted pushing exhaust gas out. The scavenging is not "free". Work is still done. Scavenging merely helps to aliviate what would be even more work being done by the engine. Also note that the psi values will vary from engine to engine, but the curve remains approximately the same. Values over 6 psi are generally considered excessive backpressure.
The graph above is a typical representation of what exhaust port pressure looks like as the engine rotates through almost a full revolution during the scavenging RPMs. Exhaust pressure builds as soon as the exhaust valve opens. This occurs before bottom dead center. Most of the torque the engine generates is produced by 90 degrees, thus it is not necessary to keep the exhaust valve closed much past 90. By opening the exhaust valve early, the high cylinder pressure helps to accelerate the charge in the exhaust manifolds. Pressure peaks before bottom dead center and then rapidly falls as the accelerated charge pulls the exhaust out of the engine. As the piston approaches top dead center, the intake valve opens. Pressure drops again and the exhaust gas actually helps to suck the intake charge into the cylinders.
These ideal conditions can only be met at certain RPMs. To do this one can vary the size of their piping to chose what will provide them the best performance. Smaller pipes will move an equal volume of gas at a higher speed. This typically comes at the expense of increased backpressure (resistance to flow) which inturn leads to poorer performance. A smaller pipe will help to maintain the ideal exhaust gas velocity when the engine is running in the lower RPMs. This provides for a torque boost off the line with improved streetability and driveability. For this reason many manufacturers size their pipes on the more conservative side. As the RPMs increase though, the backpressure builds due to the excessively small pipe size. This pushes the velocity of the exhaust gas out of the scavenging range and saps power on the top end, reducing performance in that spectrum.
A larger pipe will maintain ideal exhaust gas velocity on the top end. This will increase peak power. The downside comes with a slow exhaust charge on the low end. Their will not be enough suction to aid in the expulsion of exhaust gas. Torque will suffer in the low ranges for this reason. Too large or too small of a pipe will push the scavenging bonuses out of the useable RPM range and will result in diminished overall performance. It is important to size the piping correctly for the desired application: low end or top end. One should also consider how this will effect the rest of the car. For instance, if the car has an automatic with a stall speed of 1,500 RPMs it won't do any good to have all the power on the top end when off the line performance will suffer terribly. Likewise if the car is mainly driven in the city or through heavy traffic, a lack of low end grunt might make driving more of a chore.
On valve overlap scavenging also helps to draw in the fresh intake charge. The pressure in the exhaust port drops again and the exhaust flows more easily. It should be noted though that too much exhaust velocity on overlap can cause "over scavenging". This occurs when the exhaust vaccum becomes so great, due to overly small tubing, that it actually sucks the intake charge right through. This leaves spent charge in the cylinders and causes a loss in performance.
Common Views
A couple of commonly recommended modifications are increasing backpressure for lowend performance, and the use of equal length headers. Backpressure is almost always a bad thing. The higher velocity of a smaller pipe is what one wants on the low end. Unfortunately this ultimately chokes off the top end to an extent. Since these two go hand in hand (small pipes and top end back pressure), people often consider them the same. They are not. Putting a sharp bend in a pipe will cause high backpressure, but it will have little benefit for performance and scavenging. Backpressure is very useful for quieting an exhaust though and muffling the sound waves. As for equal length headers, companies often claim that they help with scavenging. They are used to line the exhaust pulses up. This can help during scavenging as the exiting charges will not try to occupy the same collector at the same time. Instead, the exhaust pulses will alternate and "zipper" there way into the collector. This results in smooth flow and optimal performance. Equal length headers, or headers designed to take advantage of scavenging in general are a plus. It is important to buy from a reputable company though as equal lengths will not guarentee optimal performance. Dynometer testing is the best way. Most reputable exhaust companies do make use of a dyno which gives some assurance as to what one is getting.
Summation
1. Choose a smaller pipe for better low RPM performance, a larger one for high RPM performance.
2. Remeber that peaks are not everything, as seen in Understanding Performance, thus a proper sized pipe will deliver better results than one that may give the highest peak low end or top end performance.
3. Back pressure is almost always a bad thing.