According to Faraday's law of induction, a change in magnetic field induces a current in a wire and a current flowing in a wire causes a changing magnetic field. This is modeled by the following formula:
Where:
Therefore, in order to induce the current, we need to move the magnet into and out of the coil. That way we create the change in the magnetic field that is required.