In US college engineering curriculum, Fourier Series is mostly taught as a tool for solving PDEs, and Fourier Transform signal processing. That means students are not expected to ask why they work or how did they came about.
The person named after this math machinery Jospeh Fourier was among Napoleon’s Egypt expedition entourage, serving military logistics. Fourier Series was proposed 10 years after the Egypt campaign. It would be hard not to speculate the influence or even inspiration that Egypt mythology had on its formulation.