Generators work by using a fuel source to power an engine. The engine then turns a shaft, which in turn spins a magnet. The spinning magnet creates an electromagnetic field, which produces electricity.