Aperiod vs Period waveform Fourier Transform: How does nature understand which is the case?
The Fourier transform is a linear transform.  That means the transform of a long series of pulses is identical to adding the full complex transform of each individual pulse.  If you try this, carefully respecting the time offset of each pulse, and the different FT phase result that that implies, you will see something interesting.  What happens is that the spectra at the harmonic frequencies will reinforce (due to the phase at that frequency of all the individual FTs being identical), and all the other frequencies will start to destructively interfere (due to non-alignment of phase of each pulses FT from all others), and thus will tend towards zero.

This is because the phases of any frequency will only all line up when adding pulses that are spaced an identical amount equal to an exact integer multiple of the period.  e.g. periodic.  The phases of all other frequencies will be “scrambled”.  And more scrambled the more you add them together.  Eventually summing to near zero (relative to the peaks).

That’s how the change happens, by constructive and destructive interference of the Fourier spectra as the pulses are added, gradually changing a single Sinc-like spectra into something approaching the spectra of a long periodic signal, which is a comb of harmonics.

Note that to do this addition, you need the full complex transform (including phase), not just a magnitude spectra.  A spectrum analyzer's long FFT window does this.

Added: You can't see the change because the spectrum analyzer has already added up multiple pulses before displaying anything. (long FFT window)