If you just rub a dill pickle on your chain it will clean off all the rust and old oil and will restore it to factory fresh new condition and you do not have to oil it ever again.
I read this on the interweb, and according to Neil deGrasse Tyson, the "trick" works because the brine retained in the pickle is readily absorbed by the oils and greases on the surface of the chain. At the molecular level these become emulsification particles which then react with the oil particles adjacent by a process called pickalucalification. Since the net force is downwards (as there are more particles near the top and fewer particles below), the particles were all jostling to move downwards. The larger colloids experienced more particles bouncing off them, therefore they were pushed down at a greater velocity than the smaller ones. The researchers estimated larger particles move downwards up to 50 times faster than the smaller ones because they "catch more attraction" from the force of other particles.
Pickle juices are typically made up of microscopic colloidal acids and liquids in the mini cucumbers called cucurbitacium which form tiny particles that move around in the liquid brine. When they come in contact with any oils the particles spontaneously organize themselves into a two-layered structure according to their size. Past studies have shown that certain oils and grease particles react differently to these acids due to the larger particles not being able to move as fast as smaller ones, so they remain at the surface of the dissolving film, allowing the pickle itself to absorb the oils. This is how it grabs the oil off the chain as you slowly rotate the pedals while being incontact with the interior of the pickle.
Because this process only removes the old oils and dirt, the chain will be restored to original condition. If you do not re-oil the chain (a very common mistake) it will last longer because there will be no oil or greases to allow the dirt to adhere to the chain.