How does Cas9 interact with CRISPR?
We are currently using CRISPR in the lab to modify cells. Like @AMR said, it was modified from the In Vivo immune system to be used in the lab in DNA editing field. The Addgene website features both historical background and an application guide that are very well done. To answer your questions:


The bacteria (S. pyogenes, S. aureus, etc) integrates part of the viral DNA (protospacers) inside its genome, flanked by repeats. When transcribed the RNA derived from this newly combined sequence will direct the Cas9 protein to the viral DNA, which is complementary. Another element required is the PAM (protospacer associated motif) which is on the viral DNA just besides the protospacer. By not being on the bacterial DNA, it ensures that the Cas9 does not cut its own DNA. 
The only limitations are the PAM and the off-targets. The PAM is specific for every species (EG S. pyogenes is NGG). Some sequences can be repeated in the genome of an organism, meaning that if you find a sequence that would result in a cut at a desired site, it could still cut elsewhere. That would make the guide sequence a poor choice.