Ruben R. answered 06/21/22
Experienced Advanced Math, Physics Tutor
Hi, Statistics and Computer Science student here with experience in Physics.
What you’re referring to is the Wave-Particle Theory, which was developed in 1905 by Albert Einstein.
Electromagnetic energy is released when electrons return to lower energy levels in atoms. When an electron returns to this lower energy level, electromagnetic energy is released as a separate bit of energy (called a photon). Although this photon resembles a particle, it travels through space like a wave.
So electromagnetic radiation is made up of waves of photons. The amount of energy in a single photon depends on the frequency of the electromagnetic wave. Waves that have higher frequencies (more waves per second), have photons with more energy.
This video by TED-Ed explains the phenomenon well: https://youtu.be/J1yIApZtLos
Hope that was helpful!