Clustered,regularlyinterspaced,shortpalindromicrepeats (CRISPR) loci and their associated genes (cas) confer bacteria and archaea with adaptive immunity against phages and other invading genetic elements. A fundamental requirement of any immune system is the ability to build a memory of past infections in order to deal more efficiently with recurrent infections. The adaptive feature of CRISPR-Cas immune systems relies on their ability to memorize DNA sequences of invading molecules and integrate them in between the repetitive sequences of the CRISPR array in the form of ‘spacers’. The transcription of a spacer generates a small antisense RNA that is used by RNA-guided Cas nucleases to cleave the invading nucleic acid in order to protect the cell from infection. The acquisition of new spacers allows the CRISPR-Cas immune system to rapidly adapt against new threats and is therefore termed ‘adaptation’. Recent studies have begun to elucidate the genetic requirements for adaptation and have demonstrated that rather than being a stochastic process, the selection of new spacers is influenced by several factors. We review here our current knowledge of the CRISPR adaptation mechanism.