When a virus attacks a bacterial cell, the cat will go in and excise a segment of the invading viral DNA to stitch into the bacterium's CRISPR region. This allows for the viral code to be captured in RNA. This RNA will then bind to Cas9 and search for matching viral codes in the cell. if a match is found, Cas9 recognizes it and swiftly destroys the DNA