How Is Electricity Generated? An electric generator is a device for converting mechanical energy into electrical energy. The procedure is based on the relationship among magnetism and electricity. Whenever a wire or some other electrically conductive content moves across a magnetic discipline, An electrical present happens inside the wire. The lar