Anodizing uses an electrical current to form a porous aluminum oxide layer on the surface. Since it is initially quite porous a dye can be used to give the metal a colour after the anodizing process but before the surface is sealed. Boiling the part in plain water seals the surface somehow and it won't easily stain afterwards.
It's pretty easy to do at home, not terribly dangerous if you're respectful of the chemistry and electricity.
"Anodizing" just means using the aluminum as an anode. It's put in an acid solution (sulphuric acid as I recall, hydrohcloric acid dissolves aluminum) with a cathode usually made of lead. So the aluminum is positive (the anode) and the lead is negative (the cathode), you use a DC power source providing the required amperage (calculated from the surface area of your aluminum piece) for the required time.
Some alloys take colour poorly; sheet and extruded pieces generally come out very good but cast pieces tend to be splotchy. An anodized surface won't polish well at all, the modified surface just gets polished away.
Anodizing provides a fairly protective surface for aluminum but don't expect it to handle corrosive environments (road salt and water make a good corrosive environment).