The gel electrophoresis apparatus consists of a sheet of gel - approximately the consistency of Jell-O - made of a water-based, cross-linked polymer. The composition of the gel depends on the approximate size of the DNA segments to be compared. For smaller segments, polyacrylamide is used; for larger segments, agarose (a naturally-occurring seaweed polymer) is used. On a molecular level, this polymer is like a three-dimensional cobweb, full of gaps partially separated by linked molecules.
On one end of the gel sheet, small holes called wells are cut, giving the sheet a jagged edge. Beyond the other end is an ionic buffer solution. The gel and buffer are in a tray with electrodes at either end. The negative electrode is at the end with the wells, while the positive electrode is at the end with the buffer solution.
Each prepared DNA sample is deposited into one of the wells and the electric current is turned on. The buffer solution ensures that the DNA segments have a negative charge (from the phosphate ions in the DNA chain). The negatively charged DNA segments are attracted to the positive electrode. This attraction is called electromotive force (emf), and it causes the DNA segments to move through the gel toward the buffer end.
The key to electrophoresis as an analysis tool is that the rate at which a DNA segment travels through the buffer is a direct function of its length. After an appropriate period of time, the electric current can be turned off, and the DNA segments of each sample will come to rest at a specific location in the gel. The smallest fragments will travel most quickly through the polymer mesh. Larger fragments experience more friction and travel more slowly.