An electromagnetic wave is able to produce both an electric field and a magnetic field because.

photons absorb magnetic energy

the fields continually recreate each other

they behave like matter instead of waves

they are always made at the same time