An E. coli bacterium looks a bit like a squid, with a bunch of long filaments protruding from the body. At the end of each of those filaments is a specific protein called FimH, which can change its shape to form a tiny hook; with that hook, the bacterium hangs on to a particular sugar molecule on the outside of human cells, called a ligand. “It’s not the type of sugar we put in our coffee, but it’s a close relative,” says Maier, one of the study’s co-authors. The filaments, “are really long and they only grab at the very ends,” he explains, likening the hooking mechanism to the tip of arrow—once you push it through a surface, you can’t pull it back out. That enables E. coli to stay attached to human cells even when we pee, which generates rather strong currents, at least by bacterial standards. In fact, the stronger E. coli is pulled by those currents, the tighter it holds on to the ligand molecule.

But once the “urinary storm” is over, FimH can change its shape again and pull out its hook, letting the bacteria move up the urinary tract. Maier and one of his study co-authors, Beat Ernst, a molecular-pharmacy researcher at the University of Basel, observed this behavior in a petri dish coated with ligand molecules. “They release the lock and the ligands, and are free to swim with their little motors,” Maier says—the bacterium comes equipped with thrusters that propel it up the urinary tract like a tiny submarine.

Interestingly, all that clinging and swimming activity goes pretty much undetected by the human body. The tiny hooks digging into our cells don’t cause the characteristic sensations of a UTI; rather, the pain and burning come from the later stage of infection at which E. coli forms a biofilm, a thriving bacterial community. At that advanced stage, E. coli breaks our cells, causing pain and sometimes bleeding, and eats the cellular debris it creates. “They feed on floating extracellular material, all kinds of components,” Maier says. “They’re very versatile in metabolizing compounds.”

Scientists don’t yet have a full grasp of how we acquire E. coli, in part because these infections are hard to trace—the bacterium may sneak in through the digestive system and lie dormant for weeks or months. And not all infections get an epidemiological record—if a case is obviously a UTI, doctors may phone in prescriptions without running tests, says Amee Manges, a researcher at the University of British Columbia who studied how humans acquire E. coli. Infections likely come from multiple sources. Some may be passed from person to person, and others through food. In young women, transmission of E. coli has been linked to frequent or recent intercourse; in older women, to hospital stays. UTIs may also be caused by food-borne bacteria: In a recent study, Manges found genetic similarities between the E. coli strains present in humans and in chicken meat. These strains may be particularly antibiotic-resistant, because of the antibiotics used in chicken feed.