Fimbriae and pili are protein filamentous structures on bacterial cells that facilitate adhesion and conjugation. Fimbriae are shorter and found in both gram-positive and gram-negative bacteria, while pili are longer, primarily in gram-negative bacteria, and are involved in mating processes and DNA transfer. Both structures contribute to pathogenicity by enhancing bacteria's ability to colonize hosts.