How do Fish generate electricity?

Electricity in fish is generated by the normal functions of nerves and muscles together with a chemical reaction. The electricity is produced in modified muscle tissue called electric organs. The nerves from these organs are joined to the brain. The electricity is produced by the passage of a stimulus along a nerve and a contraction in a muscle. The discharge goes from the belly to the back. It is a defensive mechanism in most cases, but is also used to kill the prey. Fishes are immune to their own shocks because of the insulating layers of fat.