During primer extension, the DNA polymerase sometimes inserts a ddNTP instead of a dNTP.
The ddNTP lacks the 3'-OH needed to attach the next nucleotide, terminating the chain.
Gel electrophoresis separates the new fragments that terminate at the ddNTP.
By tagging the ddNTP with different fluorescent dyes, the original nucleotide sequence can be determined.