Researchers now believe that cranberries contain substances that prevent infection-causing bacteria from sticking to the urinary tract walls. There are a couple of different theories about how exactly cranberries do this. Some studies show that certain antioxidants in cranberries change the bacteria so that they can't stick to the urinary tract. Another idea is that cranberries create a Teflon-like slippery coating on the urinary tract walls that prevents E. coli from getting a good grip.