Rust is the product of a complex electro-chemical process that is known to chemists as oxidation. Electrical pathways provide a means by which a metal is combined with oxygen to produce an oxide (rust, in iron's case).
Sometimes this process protects the rest of the object from further oxidation. Copper is a good example. When a copper structure is first put up, it looks like a shiny penny, but very quickly it starts to turn green. This coating of surface oxidation is called a protective oxide layer and slows the oxidation of the rest of the object. However, over a long time or in metals that don’t benefit from protective oxidation the oxidation goes much further and eats away the entire object. Luckily, the elemental metal is never destroyed. Through the magic of chemistry and a good deal of electricity, one could theoretically turn a pile of rust into a pile of iron.
Oxidation-Reduction reactions (Redox) are the bane of some chemistry student's existence, but the good part is that they are reversible in most cases and explain a horde of processes. These reactions drive processes such as fire, rusting, batteries, and electroplating. The battery in your car uses equations similar to the ones below every time you charge and discharge it.
Here is the basic reaction for oxidation and reduction of Copper:
<center> 2 Cu(s ) + O2(g ) –> 2 CuO(s )
CuO(s ) + H2(g ) –> Cu(s ) + H2O(g ) </center>
I've left out some the electrons that are the nuts and bolts of this process- you should be a chemist if you’re really that interested. The latter reaction represents rusting, while the former represents what we want to do. If you work out the chemistry, the second equation is endothermic, which means it requires energy to progress. This is where the electrolysis comes in.
In nature, the exothermic (first) reaction wins out because it releases energy. Therefore, over time, an object will oxidize. Electrolysis is splitting something (lysis) with electricity (electro). In this case, it's water.
Since oxidation is both a chemical and electrical process, we can force the reaction in the desired direction by applying a voltage and current. The electric current serves two purposes: 1. To provide excess hydrogen in the water for recombination with released oxygen, and 2. To provide the energy for the second reaction to take place.
If you thought something dramatic was going to happen, sorry to disappoint. The Electrolytic Martini for a Penny shows how boring this process is even at x32. Look closely and you might be able to see some bubbles forming on the penny.
When you turn on the electricity you should see current flow and voltage across the anode and cathode. The amount of current and voltage should be within the limits of your power supply. The amount of electrolyte you use can effect the resistivity of the water thus the amount of current flow for a fixed voltage.
Tiny bubbles should be forming at the anode and cathode. This is hydrogen and oxygen coming out of solution. Congratulations, you have just made a hydrogen fuel cell. This process doesn't contribute to our goal since that hydrogen is coming out of solution as opposed to binding with released oxygen. These bubbles are very subtle.
After a while, your tub will get filled with crud. As the process continues, you will notice big pieces of rust and other junk floating around in a nice pool of scum. As the oxidation is converted back to elemental metal at the oxidation-metal boundary, the rust that wasn't lucky enough to be transformed back breaks off. Don't worry, it was worthless anyway.
As the current draw decreases, the process is coming to a close. As you pull the object out of the bath, it is exposed to air again and no longer has that current pushing the reaction in the reduction direction; therefore, it will begin to oxidize again. Often times a protective oxide layer is immediately formed on the object once it is removed from the bath.
If you do this a couple of times, you'll get the hang of the process. After that, here are a few more things you can play around with:
Scale it up: Large baths, large items, lots of current.