Step 1 (Quantized states): The energy of an atom is not continuous; it is restricted to a ladder of allowed levels. Think of it as steps of a staircase, an electron can stand on a step but never in the empty space between steps.
Step 2 (Photon must match the gap): To move up a step the atom must swallow a photon whose energy exactly equals that step's height, \(E_{photon} = \Delta E\). If the photon energy does not match a gap, it is simply not absorbed. When the electron drops down, it releases a photon of exactly that gap energy.
Step 3 (Definite frequency follows): Because photon energy and frequency are linked by \(E_{photon} = h\nu\), matching a fixed gap \(\Delta E\) fixes the frequency \(\nu = \Delta E / h\). Only these special frequencies interact with the atom, which is why atomic spectra are line spectra.
\[\boxed{\text{Discrete energy gaps} \Rightarrow \text{only definite frequencies absorbed or emitted.}}\]