Actually, it's Bernoulli's Principle
The "toothed bar" does pop up to deflect air, but not for the express puspose of quieting the sound of rushing air. Try cruising along at 50 mph or more and manually hold down the bar with the sunroof all the way open and all your windows closed - it'll be pretty damn uncomfortable, not just noisy.
Bernoulli's Principle deals with the characteristics of moving air & pressure differentials. Bernoulli realized that, as fluid accelerates, the pressure exerted by the fluid decreases. It turns out that the molecules composing the fluid use up their energy for acceleration and therefore have less energy available to exert pressure.
Big deal, right? Well, the application of these phenomena to moving airstreams led to the development of the wing (man-made wing) and modern air travel. As air accelerates up & over the curved wing top surface, it has to accelerate to make it over and it therefore exerts less pressure on the wingtop. The air passing underneath the wing exerts more pressure (relativistically speaking) and therefore lifts the airplane.
Look at your BMW from the side: it's more or less shaped like a wing...meaning flat on the bottom and curved (longer) across the top. Measure front to back straight underneath and compare to front to back linear dimension up the grill, over the hood, up the windshield, over the roof, down rear windshield, across deck, down to bumper. Bernoulli's Principle applies. When you have the sunroof open and all the side windows closed, you have a conflict between the accelerating, lower pressure air passing directly above the open sunroof. You are sucking air out of the cabin and getting caught in all sorts of eddies & chaos. The little toothed bar just mixes up the air stream a little. Try holding that thing down with your fingers with all your windows up and see what you get.
edit: and the physical effect caused by the principle is indeed called the Bernoulli Effect