Your Rave valve (Rotax Adjustable Variable Exhaust) It regulates the exhaust flow. When rpm's go up and the pressure in the exhaust ports build up, the exhaust pushes against the spring and the valve slides up making the exhaust opening bigger. So the more the red cap is turned in the tighter the tension on the spring, which in turn will allow the exhaust ports to open at higher rpms.
This is how it is explained in the manual
For a 2-stroke-cycle engine to have high power capacity
at high crankshaft speeds, a high volumetric
or breathing efficiency is required and the fresh
charge losses must be minimized. The result is
achieved by opening the exhaust port early and
utilizing the resonant effects of the tuned exhaust
system to control fresh charge losses.
When an engine of this design is run at a medium
speed, efficiency falls off quickly. The relatively
high exhaust port effectively shortens the useful
power stroke and because the exhaust system is
tuned for maximum power, there is a large increase
of fresh charge losses. As a result, the
torque decreases along with a dramatic increase
of the specific fuel consumption. Higher torque
along with lower fuel consumption can be obtained
at lower engine speeds if the time the exhaust
port is open is shortened.