An electrical generator converts mechanical energy into electrical energy using electromagnetic induction. It has two main parts - a rotor that turns within a stationary stator, generating a magnetic field. As the rotor turns, the magnetic field changes and induces electricity in coils within the stator. Generators can be powered by steam, combustion engines, or renewable sources like wind turbines. They provide power for electric grids and a variety of applications including vehicles, bicycles, and sailboats.