My root beer contains yucca extract. It says so right on the label.
As much as 12% of extracts of the plant Yucca schidigera are soap-like compounds called saponins.
Saponins are natural detergents, or surfactants. In root beer, they make the foam. Yucca saponins have a steroid base attached to carbohydrates. This makes one end of the molecule soluble in water, and the other end soluble in fats and oils. This lets them emulsify fats and oils, so they mix with water, and helps them stabilize tiny bubbles by forming a tough film at the water/air interface.
But saponins have some other rather remarkable properties besides foam making. They are stongly attracted to cholesterol. Like some cholesterol lowering drugs, they attach to cholesterol in the intestines, and prevent it from being absorbed into the body. And since the cell membranes of many pathogens such as Giardia lamblia have cholesterol as an important component, the saponins can cause the cell membranes to rupture, killing the organism and preventing disease. They also have similar antiviral and antifungal effects, and since many cancers have more cholesterol in their cell membranes than normal cells, there appear to be anticancer benefits to yucca extract also.
By locking up bile acids in the intestine, yucca saponins prevent bacteria from creating cancer causing secondary bile acids and may prevent colon cancer.
Yucca extract binds to ammonia, and is used in animal feeds and kitty litter to control odors.
So drink your root beer. It’s good for you.