To compare DNA between species, scientists must work out the sequence of bases along sections of the DNA molecule. DNA is a special molecule because it can make copies of itself. Occasionally mistakes are made in the copying process - these are called mutations. Many mutations don't have a noticeable effect on the organism. Over a very long time and through many generations of organisms, mutations accumulate.
Different species tend to have different, and unique, sets of mutation.
Mutations can thus be used to measure how long ago two species diverged from one another.