Diffraction.
Plane-wave light hits a diffraction grating of N slits and lands on a screen far away. In the Fraunhofer limit the result is a product of two interference factors: a wide single-slit envelope and a sharp N-slit comb. Slide the slit count up and watch the broad blob collapse into the bright, narrow principal maxima a spectrometer relies on.
What you're looking at.
Two factors govern the pattern: a wide sinc² envelope from a single slit of width a, and a sharp N-slit factor (sin N γ / sin γ)² where γ = π d sin θ / λ. The envelope decides which orders are visible at all; the N-slit factor decides how narrow each one is. Multiply them and you get I(θ) = (sin β / β)² · (sin N γ / sin γ)².
Principal maxima fall where d sin θ = m λ for integer m. Between any two adjacent principals there are N − 2 tiny secondary maxima, each roughly 1 / N² as bright as a principal. Push N from 2 up to 20 and watch the bright fringes go from broad humps to surgical lines — the limit a real grating exploits.
Why spectrometers use gratings: the principal angle depends on λ, so two close wavelengths peel apart further at higher orders m. The resolving power scales with N · m. Flip the toggle to white-light and the orders past the central peak fan into rainbows — chromatic dispersion, the same trick behind every grating spectrometer.