SalvadoriRacing is correct !!
Copied from above: Read last paragraph !
A 2-stroke is different of course since there is only a finite amount of fresh mixture available in the crankcase to be transferred up into the cylinder. In a 2-stroke, we want to maximize the retention of that finite fuel charge. We can't afford to "waste" any of it by having it escape out the exhaust port.. This is not a concern in the 4-stroke because the intake flow of fresh mixture is unlimited, or at least limited only by the duration of the intake valve timing. The closing of the exhaust valve prevents significant escape of the incoming charge.
The exhaust tuning of a 2-stroke is designed to preserve the positive pulse going down the pipe and reflect that positive pulse back up the pipe. A racing engine exhaust system uses an expansion chamber at the end of the pipe which is basically two cones that reverse themselves prior to the end "stinger" where the spent exhaust is allowed to exit the chamber.
That sort of expansion chamber creates a very strong positive wave reflection back up the exhaust pipe, and this positive pulse will reduce the amount of fresh charge escaping out the exhaust port, and in some cases, force back into the cylinder any charge that may have escaped before the positive pulse arrives.
On 2-stroke racing engines, we will see an immense change in power delivered when the exhaust system is tuned for a particular RPM range and the engine revs into that range. It's called "coming on the pipe" and the burst of sound and power that occurs when that happens is easily witnessed.
The length of the exhaust pipe, prior to the muffler, is another important factor due to the speed of the pressure waves mentioned earlier. The length must be such that the exhaust pulse can travel to the end of the cone and be reflected back up the pipe to arrive at the exhaust port just before it closes.
Higher RPM will require a shorter pipe and lower RPM a longer pipe to produce the maximum effect at the RPM we want to use for maximum horsepower. It's not practical to vary the pipe length, so we compromise with some specific length that will deliver the best push at near top RPM.