Electroreception and electrogenesis are the closely related biological abilities to perceive electrical stimuli and to generate electric fields. Both are used to locate prey; stronger electric discharges are used in a few groups of fishes (most famously the electric eel, which is not actually an eel but a knifefish) to stun prey. The capabilities are found almost exclusively in aquatic or amphibious animals, since water is a much better conductor of electricity than air. In passive electrolocation, objects such as prey are detected by sensing the electric fields they create. In active electrolocation, fish generate a weak electric field and sense the different distortions of that field created by objects that conduct or resist electricity. Active electrolocation is practised by two groups of weakly electric fish, the Gymnotiformes (knifefishes) and the Mormyridae (elephantfishes), and by Gymnarchus niloticus, the African knifefish. An electric fish generates an electric field using an electric organ, modified from muscles in its tail. The field is called weak if it is only enough to detect prey, and strong if it is powerful enough to stun or kill. The field may be in brief pulses, as in the elephantfishes, or a continuous wave, as in the knifefishes. Some strongly electric fish, such as the electric eel, locate prey by generating a weak electric field, and then discharge their electric organs strongly to stun the prey; other strongly electric fish, such as the electric ray, electrolocate passively. The stargazers are unique in being strongly electric but not using electrolocation.
The electroreceptive ampullae of Lorenzini evolved early in the history of the vertebrates; they are found in both cartilaginous fishes such as sharks, and in bony fishes such as coelacanths and sturgeons, and must therefore be ancient. Most bony fishes have secondarily lost their ampullae of Lorenzini, but other non-homologous electroreceptors have repeatedly evolved, including in two groups of mammals, the monotremes (platypus and echidnas) and the cetaceans (Guiana dolphin).