Localized time-different cost and present-day densities can work as sources of electromagnetic waves in the vacuum. Maxwell's equations can be written in the form of the wave equation with sources. It proceeds in the shape of rarefaction and compression which is the extend and compression in the exact same course https://www.generationgenius.com/videolessons/electromagnetic-spectrum-video-for-kids