Basically what this is, is an example of treating a function like a vector (in fact, it's an infinite dimensional vector space as opposed to the normal vectors which are in a finite dimensional space).
What you are doing is taking a function and treating it like an infinite-dimensional vector and breaking it down by projecting it to a set of orthogonal vectors to get the component of the function that belongs to a particular vector.
Since all the vectors in the fourier basis are orthogonal to each other, it means that each projection will contribute only to that basis vector and no others (just like i,j,k are all orthogonal in R^3).
So what you are doing is in fact treating a function like a vector and projecting to a particular basis (namely the Fourier basis).
There are in fact, many different bases that you can project to just like there are many different orthogonal bases in R^3 (not just i,j,k) and this particular kind of thing is the subject of Fourier Analysis and Orthogonal Polynomials and functions.