With the batteries dead, the coolant pumps failed. With no fresh coolant flowing into the reactor core, the water that kept it cool began boiling off. As the water boiled away, the tops of the fuel rods were exposed, and the metal tubes holding the uranium fuel pellets overheated and cracked. The cracks allowed water to enter the tubes and get to the fuel pellets, where it began generating hydrogen gas. The process is called thermolysis -- if you get water hot enough, it breaks down into its constituent hydrogen and oxygen atoms.
Hydrogen is a highly explosive gas -- recall the Hindenburg explosion, in which the Hindenburg was full of hydrogen gas. In Japan's nuclear plants, pressure from the hydrogen built up, and the gas had to be vented. Unfortunately, so much hydrogen vented so quickly that it exploded inside the reactor building. This same chain of events unfolded in several different reactors.
The explosions did not rupture the pressure vessels holding the nuclear cores, nor did they release any significant amounts of radiation. These were simple hydrogen explosions, not nuclear explosions. The explosions damaged the concrete and steel buildings surrounding the pressure vessels.
The explosions also indicated that things had gotten out of control. If water were to continue boiling off, a meltdown would be almost assured.
So operators decided to flood the reactors with seawater. This is a last-ditch effort to control the situation, since seawater completely ruins a reactor, but it's better than a meltdown. In addition, the seawater was mixed with boron to act something like a liquid version of the control rods. Boron absorbs neutrons and is one of the main constituents in the control rods.