The process involves placing a sample in a gel matrix and applying an electric field. The molecules in the sample migrate through the gel at different rates depending on their size and charge. Smaller fragments move faster and farther than larger ones. After the electrophoresis run, the separated molecules can be visualized using various staining techniques.