What does a generator do?

transforms magnetic energy into electrical energy
transforms friction into electrical energy
transforms mechanical energy into electrical energy
transforms potential energy into kinetic energy

A generator transforms mechanical energy into electrical energy. It uses a magnet or a coil of wire to create a magnetic field and then rotates this magnet or coil to induce a current in another set of coils, which produces electrical energy. This process is known as electromagnetic induction and is used to generate electricity in power plants, wind turbines, and other renewable energy sources.