Both electric motors and generators have two basic units strong enough for their operation, the magnetic field that is the permanent magnet with their coils, and the armature, which is a laminated sweet iron core. A machine that converts mechanical energy into electric has the name of generator, alternator or dynamo, https://www.mrosupply.com/popular_products/05-hp-56-motors/ and a machine that converts electrical energy into mechanical is called an electric motor. Therefore, the generator has an inverse operation to that of the electric motor.
Numerous researchers have featured in the study of electromagnetism, but for sure Öersted and Faraday have contributed much to the development of electromagnetism. The electric current appears in the loop because of the movement of the natural magnets, which will result in a change of magnetic field, making the loop become also a magnet and will spin it. For this reason we say that the generator is a good example of practical application of the Faraday experiment. In this case, with the movement of the magnets we have mechanical energy, which proceeds in electric energy in the loop. As in the case of the engine, there are several types of generators and what we describe here is a basic example, but it has served important technological developments.