The electromagnetic induction is the operating principle behind many electric generators : for example, a rotating bar magnet creates a changing magnetic field and generates an electric field in a nearby wire.