Simply put, rusting is what makes steel tanks leak and require replacement. There are a number of factors which contribute to the rusting of water heaters. Proper installation, maintenance and adjustment will almost completely eliminate these factors.
The inside of your tank is protected only as long as the anode rod has sufficient sacrificial metal remaining on its steel wire core. Inspect the rod periodically and replace it when needed. Without a functioning anode in your tank, any other measures are just wasted energy.
Just as magnesium anode rods corrode (purposely) in the presence of steel, steel will rust (to the detriment of your tank) when it's near to copper or brass. The more of these metals there are, the more the steel tank will rust. Water heater connections such as hot, cold and re-circulation loop lines are often made of copper or brass. When they are joined directly to the tank, excessive rusting occurs at the connections, restricting water flow and weakening the steel. Dielectric unions and plastic lined steel nipples have been developed to reduce this electrolytic corrosion.
Build-Up Heat forces minerals to come out of solution, forming solids which settle on the bottom of your tank. This sediment is mostly calcium carbonate. The harder the water, the more sediment you can expect. When sediment accumulates in a gas heater, it forms a barrier between the water and the flame, slowing heat transfer. The subsequent overheating of the tank bottom can cause two problems. First, the glass lining starts dissolving at temperatures above 160 degrees, so over time, the steel tank bottom is gradually exposed to water and potential rusting. Second, severe overheating can weaken the metal bottom to the point of deforming under normal pressure. (Temperatures exceeding 1000 degrees have been measured at the bottom of severely scaled tanks)! Sediment causes additional problems. In both gas and electric heaters, a dense sediment layer can insulate the tank bottom from the protection of the anode rod. The sediment can also play host to bacteria. Most of these are not harmful to our health, but they make the environment in the sediment more corrosive, and the steel is under harsher attack than with heat and sediment alone.
Don't overlook your tank's surroundings. If the air burned in a gas heater is damp or carries salt, chlorine, or other corrosive chemicals, it will attack the tank from inside the flue and combustion chamber. It may even void the warranty. Keep your heaters dry. Many tanks have failed because a plumbing fitting (either on the tank itself or overhead) leaked and rusted through the drain tank externally. Troublemakers include the drain valve, heating elements, and hot and cold connections. Even a loose packing nut on an overhead shut-off valve may leak and ruin a water heater.
Determine Your Heater's Current Status
It's useful to determine the age of your tank before working on it. A heater's age can guide you to appropriate inspection and maintenance. For example, if a heater is only a few years old, its likely the anode rod will still have life in it. However, a heater more than six years old (or one which is using softened water and is over two years old) will probably need a new anode. Older heaters are also more likely to have troubles with a damaged dip tube and more likely to possess recalcitrant drains. To determine the heater's age look at the serial number printed or stamped onto the name plate. If it starts 0186 or A86, that means it was made in January of 1986. 0286 or B86 means February 1986. If it starts 8604, that means it was built in the fourth week of 1986. If the serial number simply does not make sense with these guidelines, look for "warranty" on the name tag; the A86 or other code may be found there. If none of this leads you to a date, proceed with servicing the unit. It probably needs it.