I am reading Section I.2 in Zee's QFT in a Nutshell. The amplitude for a particle to start at position $I$ and end at $F$ is (eq. (I.2.6)): $$ \langle q_f|e^{-iHT}|q_I\rangle=\int Dq(t)\ e^{i\int_0^T dt\ L(\dot q, q)}\tag{6} $$
In Section I.3 he then says it's better to consider an initial and final state, which are both taken as the vacuum state (eq. (I.3.3)): $$ Z\equiv\langle0|e^{-iHT}|0\rangle=\int Dq(t)\ e^{iS(q)}\tag{3} $$
When this integral is evaluated it gives (eq. (I.3.18)): $$ Z(J)=\mathcal Ce^{-(i/2)\iint d^4xd^4y\ J(x)D(x-y)J(y)}\equiv\mathcal Ce^{iW(J)}\tag{18} $$
$D(x - y)$ is the propagator, ie. the amplitude for the particle to travel from $y$ to $x$. But isn't this just equal to (6)? If so, how does it end up in the exponent of the solution to the path integral when considering vacuum states and a source term J(x)?
I am probably missing something obvious, any help would be great.