This is working on the principle of Faraday’s law which states that when a conductor moves through a magnetic field of a given strength a voltage is produced in the conductor and proportion to the relative velocity between the conductor and the magnetic field.