The CRISPR-Cas9 system works by identifying a specific sequence of DNA in the genome, using a piece of RNA as a guide. The guide RNA (gRNA) is designed to match the DNA sequence of interest. When the gRNA binds to this sequence, the Cas9 enzyme cuts the DNA at that location. The cell then tries to repair the cut, and this process can be harnessed to add or delete specific pieces of DNA, effectively enabling gene editing.