The phenomenon you're referring to is the emission of light by atoms, which occurs when electrons transition between different energy levels within the atom. When an atom releases light of different wavelengths, it's typically due to electronic transitions within the atom's electron cloud.
Inside an atom, electrons occupy specific energy levels or orbitals. These energy levels are quantized, meaning they can only have certain discrete values. When an electron absorbs energy, it can move from a lower energy level to a higher energy level, known as an excited state. This energy can come from various sources, such as heat or the absorption of photons.
However, an excited electron is typically unstable in the higher energy level and tends to return to its original, lower energy state. When this happens, the electron releases the excess energy in the form of a photon. The wavelength of the emitted photon corresponds to the energy difference between the two energy levels involved in the transition. This relationship is described by the equation E = hc/λ, where E is the energy of the photon, h is Planck's constant, c is the speed of light, and λ is the wavelength of the photon.
It's important to note that this process occurs within the atom's electron cloud and involves changes in the electron's energy levels. Although the concept of an electric field and a magnetic field at a 90° angle is relevant to the propagation of electromagnetic waves, the emission of light by atoms does not directly involve the generation of electromagnetic waves or photons in that sense. Rather, it's a result of the energy-level transitions of electrons within the atom.