Organisms have short sequences of bases, which are repeated many times. These are called satellite DNA. These repeated sequences vary in length from person to person.
The DNA is copied using PCR and then cut up into small fragments using restriction enzymes.
Gel electrophoresis separates fragmented pieces of DNA according to their size and charge. This gives a pattern of bands on a gel, which is unlikely to be the same for two individuals.
This is called DNA profiling. DNA profiling can be used to determine paternity (comparing DNA of offspring against potential fathers) and also in forensic investigations (identifying suspects or victims based on crime-scene DNA) to get evidence to be used in a court case.