Bacteria can pass on genetic changes gained during an infection
After meeting a virus, bacteria can add pieces of its DNA to their own CRISPR system. These new pieces can then pass to their descendants. In this limited way, bacteria can inherit a change gained through an encounter during life, while the CRISPR machinery itself still evolves through ordinary natural selection.