Because EM radiation is a travelling wave of electric and magnetic fields driving each other, oscillating perpendicular to each other. For details:
Khan Academy
Incidentally, this isn't just theory. For high-powered, concentrated beams of EM radiation (even if individual photons aren't all that energetic) such as cutting lasers, the electric field can be large enough to ionise air - which soaks up some of the power and leads to the beam being attenuated.