Kenton54...to expand a bit on dik's nicely done description, the water has a two-fold influence on the corrosion. First, water contains oxygen to assist in the oxidation process, and secondly water acts as an electrolyte in the process of galvanic corrosion, both of which occur in the deterioration of rebar. A third influence that water has under certain conditions is that it becomes the solvent that allows the carrying and contact of the rebar with certain water soluble oxidizing ions such as chlorides.
Water can also reduce the pH of concrete thus taking away the protective passivation it provides to the rebar when the high pH is maintained.
The corrosion of rebar can be on a microscopic or macroscopic level, usually with both occurring simultaneously. In the "micro" sense, small corrosion cells or batteries are set up on the surface of the rebar where variations in the steel occur and where certain constituents in the concrete (aluminum compounds for instance) create galvanic cells that remove material from the rebar. In the macro sense, oxidation caused by the dissolved oxygen in water or by the electrolysis of water releasing oxygen allows the premise that dik laid out.
As dik said, the corrosion of rebar can be rather complex and we've attempted to simplify and summarize it in a layman's nutshell.