what is the function of the pili?

The function of pili is to facilitate bacterial adhesion to surfaces, including host cells, and to mediate the transfer of genetic material between bacterial cells through a process called conjugation.