Picture a rectangular coil spinning between the poles of a magnet. When the coil faces the field squarely, the most field lines thread it; a quarter-turn later it is edge-on and none do; another quarter-turn and they thread it from the other side. The flux keeps rising, falling and reversing, and by Faraday's law that changing flux induces an EMF. The EMF is largest when the coil is edge-on, because the flux is changing fastest there, and zero when the coil faces the field squarely, where the flux is at its peak and momentarily not changing.
The result is a sine wave, E=NBAωsin(ωt), reversing every half-turn: alternating current. Its peak is NBAω, so doubling the spin rate doubles the peak voltage and also doubles the frequency. A coil turning 50 times a second produces 50 Hz AC, the mains frequency in much of the world. To get one-way current instead, a dynamo adds a commutator or a rectifier.
A generator is a motor run backwards: the same coil, magnet and bearings, but with motion going in and electrical energy coming out. It is not a battery, which turns chemical energy into DC with no moving parts. And it is never free: when current flows, Lenz's law makes the coil resist being turned, so the mechanical work you put in is at least the electrical energy you take out.
Think of it like this. A generator is a hand-cranked pump for charge: turn the handle and it pushes charge around the circuit, first one way and then the other as the coil turns. The more current you draw, the harder the crank becomes to turn, because every joule of electrical energy comes from your arm.
Core idea. Spinning a coil in a magnetic field makes the flux through it rise, fall and reverse, inducing an alternating EMF with peak NBAω; the electrical energy comes from the work done turning the coil against the resistance that Lenz's law predicts.