The electric eel generates large electric currents by way of a highly specialized nervous system that has the capacity to synchronize the activity of disc-shaped, electricity-producing cells packed into a specialized electric organ. The nervous system does this through a command nucleus that decides when the electric organ will fire. When the command is given, a complex array of nerves makes sure that the thousands of cells activate at once, no matter how far they are from the command nucleus.
Each electrogenic cell carries a negative charge of a little less than 100 millivolts on its outside compared to its inside. When the command signal arrives, the nerve terminal releases a minute puff of acetylcholine, a neurotransmitter. This creates a transient path with low electrical resistance connecting the inside and the outside of one side of the cell. Thus, each cell behaves like a battery with the activated side carrying a negative charge and the opposite side a positive one.
Because the cells are oriented inside the electric organ like a series of batteries piled into a flashlight, the current generated by an activated cell "shocks" any inactive neighbor into action, setting off an avalanche of activation that runs its course in just two milliseconds or so. This practically simultaneous start-up creates a short-lived current flowing along the eel's body. If the eel lived in air, the current could be as high as one ampere, turning the creature's body into the equivalent of a 500-volt battery. But eels live in water, which provides additional outlets for the current. They thus generate a larger voltage, but a divided, and therefore diminished, current.
To my knowledge, there are no specific studies on why eels can shock other animals without shocking themselves but one possible explanation could be that the severity of an electric shock depends on the amount and duration of the current flowing through any given area of the body. For the purposes of comparison, an eel's body has roughly the same dimensions as an adult man's arm. To cause an arm to spasm, 200 milliamps of current must be flowing into it for 50 milliseconds. An eel generates much less energy than that because its current flows for only 2 milliseconds. Additionally, a large part of the current dissipates into the water through the skin. This probably reduces the current even more near internal structures like the central nervous system or heart.
Of course, the current received by any small prey is also only a small portion of the total current generated by the eel. Nevertheless, the current discharged into their smaller bodies is much larger proportionally. For example, a prey 10 times smaller in length than an eel is about 1,000 times smaller in volume. Therefore, the small animals close to the eel get shocked, rather than the discharging eel itself.