The mechanism of electrophoresis is rather a brilliant idea, in my opinion. It works under the principle that all biological molecules (fats, proteins, nucleic acids, etc.) will carry some inherent charge, whether it's positive or negative. Therefore, each molecule will be capable of moving through an ionic gradient, its rate depending on the total charge of the molecule.

The typical setup is simplistic: the medium into which the gradient will be induced is placed in a chamber which has an anode (+) at one end and a cathode (-) at the other. (The charged ends should not be live at this point.) The medium is then inoculated with a sample of the molecules with which you are experimenting. There may be a label introduced directly into the medium prior to inoculation with the sample (eg. ethidium bromide); added to the sample itself or inherent in the sample (eg. radioactivity or fluorescence); or added after the procedure is finished (also works with ethidium bromide). The label will serve to indicate movement from the start point through the ion gradient, and is used to indicate size, amount, or charge of the molecule.

There are some inherent differences between fluid, gel, and membrane electrophoresis. Fluid electrophoresis seems to be most effective in measuring the charge of the molecule by its rate of movement through the charge gradient. (If anyone knows any other uses for this, please let me know. I can't think of any, and am not experienced with it.) Membrane electrophoresis is similar to gel electrophoresis, but may be more effective with smaller quantities of sample or when later removing the desired portion of the sample. The basic principle of gel electrophoresis (and membrane electrophoresis) is that the molecule is now forced to not only move through the ion gradient, but figure out how to get around the fibers (cellulose or other fibers in membrane, usually agarose or polyacrylamide polysaccharides in gel). This allows for separation not only as to charge, but as to size and shape. Smaller, linear molecules will move more quickly than larger, circular or globular molecules. Thus, gel or membrane electrophoresis would be effective in determining, say, the length of a piece of DNA or the size of a protein.

(I seem to have neglected capillary electrophoresis, which is more involved with analytical chemistry than biochemistry in my experience, but BelDion seems to have covered that nicely.)

Electrophoresis is a favoured method by many in the biochemistry, molecular biology, and genetics fields for its efficiency and effectiveness. In fact, many genomes have been at least partially mapped using the Sanger or dideoxynucleotide method of DNA sequencing, which involves oodles of electrophoresis.

See also: two-dimensional electrophoresis or 2D electrophoresis, SDS-PAGE