According to Maxwell’s theory, "accelerated charges radiate EM waves".
Consider a charge oscillating with some frequency.
This produces an oscillating electric field in space, which produces an oscillating magnetic field which in turn is a source of oscillating electric field.
Thus varying electric and magnetic fields regenerate each other.
Waves that are caused by the acceleration of charged particles and consist of electric and magnetic fields vibrating sinusoidally at right angles to each other and to the direction of propagation are called EM waves or EM radiation.
The time varying electric field is along the x-axis and time varying magnetic field is along the y-axis