This is a wonderful question because it brings up one of my favorite relationships between ordinary objects: motors and generators are basically identical! If you supply electric power to a generator, it becomes a motor and if you supply mechanical power to a motor, it becomes a generator. In fact, whether they’re labeled “motor” or “generator,” these devices are always mixtures of both concepts. As I’ll explain shortly, you don’t need a separate generator to recycle the electric power consumed by a motor. The motor itself acts in part as a generator and automatically does the recycling for you!
The detailed electromagnetics of a motor/generator are too complicated to discuss here. Instead, let’s take a look at how a motor/generator responds to the electric and mechanical powers it receives. Suppose that we simply connect a “motor” to a source of electric power and let it start turning. The motor’s rotor (the spinning part) starts from rest—the only time when the device is acting as neither a motor nor a generator. As the rotor begins to spin, it gradually begins to act as both a motor and a generator. At slow rotation rates, it is more motor than generator and it consumes electric power while producing mechanical power. But eventually it reaches a speed at which it is equally motor and generator. At this speed, it is generating as much electric power as it is consuming and it maintains a steady rate of rotation. If it slows down or lags behind this point, it will act more as motor than generator and start consuming electric power. If it speeds up or gets ahead of this point, it will act more as generator than motor and start providing electric power. Actually, there is some power wasted as heat in the wires and via friction, but for the sake of simplicity we’ll ignore that complication.
Now suppose that you connect a mechanical system to the motor/generator and begin to extract mechanical power from the device. The rotor’s rotation will slow down or lag behind and the balance between motor and generator will then be upset. The device will become more motor than generator. It will consume electric power in order to provide mechanical power.
On the other hand, suppose that the mechanical system begins to deliver mechanical power to the device. The rotor’s rotation will speed up or get ahead and the balance will again be upset. The device will become more generator than motor. It will consume mechanical power in order to provide electric power. A great way to demonstrate these effects is to connect a simple hand-powered motor/generator to an electric power storage device—either a battery or a capacitor. Connect the motor/generator to the storage device and start turning it by hand. As you do, it becomes more generator than motor and charges the storage device. It is converting mechanical power into electric power. If you stop turning it by hand or begin to fight its rotation, it becomes more motor than generator and discharges the storage device. It is converting electric power into mechanical power.
Answered by Lou A. Bloomfield of the University of Virginia.