A coil in-between a magnet rotates due to the magnetic field, and as the coil rotates, a current is induced across it. Every half rotation the current changes direction, hence producing an alternating current and potential difference. As one side of the coil moves up through the magnetic field, a potential difference is induced in one direction. As the rotation continues and that side of the coil moves down, the induced potential difference reverses direction, producing a current that is constantly changing