Bacteriophage (viruses that infect bacteria) are of key importance in ecological processes at scales from biofilms to biogeochemical cycles. Close interaction can lead to antagonistic coevolution of phage and their hosts. Selection pressures imposed by phage are often frequency-dependent, such that rare phenotypes are favoured; this occurs when infection depends on some form of genetic matching. Also, resistance to phage often affects host fitness by pleiotropy (whereby mutations conferring resistance affect the function of other traits) and/or direct costs of resistance mechanisms.