Gel electrophoresis was developed by Tiselius and is based on the principal that charged molecules move to electrode of opposite charge when placed in electric field and the movement depends on the charge and size of the molecule.
Due to the sieve-like texture of the gel, smaller DNA fragments travel faster toward the electrode than the larger fragments.