If the atom is bathed by photons whose energy is not equal to the energy difference between the state it’s in and some higher energy state, then it will not absorb the photons. Atoms can absorb energy only in specific chunks (quanta). This feature is useful for controlling the state of atoms.