It's actually, literally, a molecular antivirus program.
Much like antivirus software scans your computer for a signature of a computer virus in order to remove it, CRISPR is part of a bacterial mechanism to scan DNA for the signature of an actual virus and snip it out, preventing the virus from using the bacterium to reproduce. Biology is NUTS.