I am reading the introduction to the textbook The Quantum Theory of Light, third edition, by Louden. When discussing the photon, the author says the following:
The idea of the photon is most easily expressed for an electromagnetic field confined inside a closed optical resonator, or perfectly-reflecting cavity. The field excitations are then limited to an infinite discrete set of spatial modes determined by the boundary conditions at the cavity walls. The allowed standing-wave spatial variations of the electromagnetic field in the cavity are identical in the classical and quantum theories but the time dependences of each mode are governed by classical and quantum harmonic-oscillator equations, respectively. Unlike its classical counterpart, a quantum harmonic oscillator of angular frequency $\omega$ can only be excited by integer multiples of $\hbar \omega$, the integers $n$ being eigenvalues of the oscillator number operator. A single spatial mode whose associated harmonic oscillator is in its $n$th excited state unambiguously contains $n$ photons.
This part isn't clear to me:
A single spatial mode whose associated harmonic oscillator is in its $n$th excited state unambiguously contains $n$ photons.
Why does the single spatial mode unambiguously contain $n$ photons? This is my first exposure to quantum optics, so I would greatly appreciate it if people would please take the time to explain this.