Gel electrophoresis is a purification process whereby different proteins are separated according to their molecular weight. The charged molecules are aligned and a charge is applied that causes the molecules to move according to their weight. This separates the different fragments of the DNA according to the length and the different electrical charges.
As the molecular weight so a specific protein is constant in different people, it allows the delineation of specific constituents of a mix. In separating DNA fragments, the electrical charge allows the DNA to separate according to the length and the electrical charges. This allows the assessment of different DNA fragments to find specific genes.