The archaeal and bacterial CRISPR-Cas systems of adaptive immunity employ small guide RNAs derived from foreign or self DNA for adaptive immunity against viruses and plasmids and apparently, in some case, also for regulation of gene expression. The RNA-guided Cas nucleases comprise the new generation of genome editing tools and are often claimed to have ushered a revolution in genetic engineering. Comparative genomic analysis of the CRISPR-Cas loci identified multiple contributions of various mobile genetic elements to the evolution of prokaryotic adaptive immunity. The contributing mobile elements include: i) casposons, a newly discovered superfamily of archaeal and bacterial self-synthesizing transposons that gave rise to the adaptation modules of CRISPR-Cas and apparently CRISPR arrays themselves, ii) autonomous and non-autonomous transposons encoding the TnpB nuclease that gave rise to the RuvC-like nuclease domains of effector nucleases in type II and type V CRISPR-Cas systems, iii) toxin components of toxin-antitoxin systems that became ancestors of Cas2 subunit of the adaptation complex and the effector nucleases of type VI, iv) self-splicing introns which donated the HNH nuclease of the type II effectors. A parallel is drawn between the evolution of CRISPR-Cas, vertebrate adaptive immunity and the mechanism for DNA elimination during macronucleus maturation in ciliates. In each of these case, the molecular machinery for genome rearrangement evolved from unrelated transposons which reflects the inherent aptitude of mobile elements for these functions. Enzymes encoded by mobile elements, especially nucleases, appear to be “guns for hire” that utilized alternately for offense, defense and counter-defense by genetic parasites and their hosts.