Since electric shocks made living muscles twitch, why not dead ones, too?
Since Benjamin Franklin had shown that lightning was electrical in nature, Galvani wondered whether muscles would twitch if exposed to a thunderstorm; so, he placed frog muscles on brass hooks outside a window so they rested against an iron latticework.
The muscles did indeed twitch during the thunderstorm, but they also twitched in the absence of it. In fact, they twitched whenever they made simultaneous contact with two different metals.
Apparently, electricity was involved, but where did it come from, the metals or the muscles?
Galvani decided it was the muscles, and he spoke of animal electricity. In this, he was mistaken, but electricity was involved with nerve and muscle action just the same.
Additional info about Luigi Galvani
Galvani is famous for the discovery of animal electricity, inspired by his observation that dead frogs suffered convulsions when fixed to an iron fence to dry. He then showed that paroxysms followed if a frog was part of a circuit involving metals, wrongly believing the current source to be in the material of muscles and nerves.