A bacterium uses a restriction enzyme to defend against bacterial viruses called bacteriophages, or phages. When a phage infects a bacterium, it inserts its DNA into the bacterial cell so that it might be replicated. The restriction enzyme prevents replication of the phage DNA by cutting it into many pieces.