First consider the classical Klein-Gordon field. The equation is $(\Box +m^2)\phi = 0$ which upon using the Fourier transform becomes (here I denote the Fourier transform with the $\hat{}$ as usual.
$$(\partial_t^2+\omega_{k}^2)\hat{\phi}=0$$
this equation has solution (with the condition of reality imposed)
$$\hat{\phi}(\mathbf{k},t)=a_{\mathbf{k}}e^{-i\omega_k t}+a_\mathbf{k}^\ast e^{i\omega t}$$
which in turns end up giving the general solution
$$\phi(\mathbf{x},t)=\int \dfrac{d^3 \mathbf{k}}{(2\pi)^3\sqrt{2\omega_k}}(a_\mathbf{k}e^{-ik_\mu x^\mu}+a_{-\mathbf{k}}^\ast e^{k_\mu x^\mu})$$
There is nothing fancy here. It is the standard method for solving a differential equation with Fourier transform.
Now, when quantizing the field, the natural way to lift this expression is
$$\phi(\mathbf{x},t)=\int \dfrac{d^3 \mathbf{k}}{(2\pi)^3\sqrt{2\omega_k}}(a_\mathbf{k}e^{-ik_\mu x^\mu}+a_{-\mathbf{k}}^\dagger e^{k_\mu x^\mu})$$
which is again just the Fourier transform of operators.
Now comes my question: in one way we can deduce from this that the canonical commutation relations for $\phi$ are equivalent to the commutation relations for the $a_\mathbf{k}$ being $[a_{\mathbf{k}},a_{\mathbf{k'}}^\dagger]=(2\pi)^3\delta(\mathbf{k}-\mathbf{k}')$ and this is quite straightforward.
The problem I have is: one can then just present a way to build all this, which is the Fock space. If one defines the Fock space it comes naturaly with a pair of operators $a$ and $a^\dagger$ which obeys exactly that commutation relations and can be used to define the fields.
In this approach one knows beforehand the solution - use the Fock space - and just works with it. The operators of creation and annihilation as well as the Fock space are considered to be built first, and then the quantum fields are defined.
What I want to know is how does one arrive at this conclusion, to use the Fock space. It seems that always when one expand one operator in a Fouirer transform, the coefficients of the Fourier transform are creation and annihilation operators in a Fock space. I've even saying some people saying that "it is obvious from the expansion $\phi(x,t)$ that the Fourier coefficients are creation and annihilation operators in a Fock space".
What is thus really the relation between Fourier transform and Fock space? Why "it is obvious" that when expanding one operator into Fourier modes, the Fourier coefficients are creation/annihilation operators in a certain Fock space? How does one arrive at the Fock space by the Fourier transform?