>>12381439The idea is incredibly novel, but it's also a combination of research that came before Fourier. People had decomposed periodic functions into simple oscillating ones about 2000 years prior. Fourier was working with the metal plate, and the unsteady (I think?) heat equation had been solved assuming heat dispersed in a sinusoidal fashion. Fourier's idea was that any function could be decomposed into sums of various sin and cos waves - this isn't true in general, but it is true given some extra restrictions of course.
So to answer your question, it was inspiration, luck, and being incredibly aware of the prior work in his field that let Fourier discover the Fourier series.