Flagella are protein filaments that extend like long tails from the cell membranes of certain gram-positive and gram-negative bacteria. These tails, which are several times the length of the bacterial cell, move the bacteria around.
The flagellum is affixed to the bacteria by a basal body. The basal body spans through the entire cell wall, binding to the inner and outer cell membrane in gram-negative bacteria and to the inner membrane in gram-positive bugs (the gram-positive bacteria don’t have an outer membrane). The basal body spins around and spins the flagellum. This causes the bacterial flagella to undulate in a coordinated manner to move the bacteria toward a chemical concentration gradient or away from the gradient. This movement is called chemotaxis.
Bacteria can have a single polar flagellum (polar means at one end of the cell) as is the case with
Vibrio cholera , or many peritrichous flagella (all around the cell) as is the case with Escherichia coli and Proteus mirabilis. Shigella does not have flagella.
Spirochetes are all very slender and tightly coiled. Axial flagella come out of the ends of the spirochete cell wall, but rather than protrude out of the outer membrane, the flagella run sideways along the spirochete under their unique outer membrane sheath. These specialized flagella are called periplasmic flagella. Rotation of these periplasmic flagella spins the spirochete around and generates thrust, propelling them forward.
Pili (also called fimbriae) are straight filaments arising from the bacterial cell wall, making the bacterium look like a porcupine.
Pili are much shorter than flagella and do not move. Pili can serve as adherence factors (in which case they are called adhesins). Many bacteria possess adhesins that are vital to their ability to cause disease.
For example, Neisseria gonorrhea has pili that allow it to bind to cervical cells and buccal cells to cause gonorrhea. Escherichia coli and Campylobacter jejuni cannot cause diarrhea without their adhesins to bind to the intestinal epithelium, and Bordetella pertussis uses its adhesin to bind to ciliated respiratory cells and cause whooping cough.
Bacteria that do not produce these pili cannot grab hold of their victim; they lose their virulence and thus cannot infect humans. There are also special pili, called sex pili.