So when a DNA virus gets into a host cell, certain fragments of it called Protospacers are incorporated into the host's genome, becoming the spacers in CRISPR locations.
So, when a virus invades a cell, if there is an associated spacer already there, meaning it's on the most-wanted list, the bacterium can go on to destroy the virus.