Pili, sometimes called sex pili, are used for bacterial conjugation. They connect the bacterium to another of its species and build a bridge between the cytoplasm of either cell. That enables the transfer of plasmids between the bacteria. An exchanged plasmid can add new functions to a bacterium, e.g., an antibiotic resistance.
A fimbrium (latin; plural : fimbria) is a short pilus that is used to attach the cell to a surface. Fimbria are either located at the poles of a cell, or are evenly spread over its entire surface. Mutant bacteria that lack fimbria cannot adhere to their usual target surfaces and, thus, cannot cause diseases.