A magnet driven back and forth through a coil makes the flux rise and fall, and a changing flux induces a voltage: ε = -N(ΔΦ/Δt). Faster motion, more turns, a stronger field or a bigger coil all raise the EMF — and the current reverses on every return stroke (Lenz's law).