An electricity generator is a device that converts a form of energy into electricity. Generators operate because of the relationship between magnetism and electricity. Generators that convert kinetic (mechanical) energy into electrical energy produce nearly all of the electricity that consumers use.