Adaptive immunity had been long thought of as an exclusive feature of animals. However, the discovery of the CRISPR-Cas defense system, present in almost half of prokaryotic genomes, proves otherwise. Because of the everlasting parasite-host arms race, CRISPR-Cas has rapidly evolved through horizontal transfer of complete loci or individual modules, resulting in extreme structural and functional diversity. CRISPR-Cas systems are divided into two distinct classes that each consist of three types and multiple subtypes. We discuss recent advances in CRISPR-Cas research that reveal elaborate molecular mechanisms and provide for a plausible scenario of CRISPR-Cas evolution. We also briefly describe the latest developments of a wide range of CRISPR-based applications.