1) A "connected" diagram is a diagram that cannot be separated into two diagrams by cutting a single edge. A single connected diagram is a distinct integral which is a function of a single momentum defined by that edge, so each of these connected diagrams is a simple factor. So any given diagram can be factored into terms that are each represented by these "connected" diagrams.
2) Consider all of the possible connected diagrams $C_i$
indexed by $i$. For any specific diagram, the vectors of counts $n_i$ of $C_i$'s comprising the diagram can be taken as the index over diagrams $D_{[n_i]}$. So, the sum over diagrams
$\sum_{[n_i]} D_{[n_i]} = \sum_{[n_i]} \prod_i \frac{C_i^{n_i}}{n_i!}$ where the $\frac{1}{n_i!}$ counts the $C_i^{n_i}$ only once. Partitioning these into clusters of size $N$, where $\sum_i n_i = N$ yields $\sum_{[n_i]} D_{[n_i]} = \sum_N \sum_{[n_i], \sum_i n_i = N}\prod_i \frac{C_i^{n_i}}{n_i!} = \sum_N \frac{1}{N!}\left(\sum_i C_i\right)^N =\exp\left(\sum_i C_i \right)$
There are $n_i!$ combinations of $\delta J_1 \delta J_2 ...$ that generate $C_i$. The number of combinations for the $\prod_i C_i^{n_i}$ terms is $\frac{N!}{\prod_i n_i!}$ counting all the diagrams generated by the $\frac{\delta}{\delta J}$'s from $Z[J]$ with $N$ clusters.
3) The argument can be extended to include both connected diagrams $\sum_i C_i$ attached by 1 edge and vacuum bubbles $\sum_j B_j$ attached by no edges. Then for these diagrams that include both clusters and bubbles, $\sum_{[n_i]} D_{[n_i]} = \exp\left(\sum_i C_i + \sum_j B_j \right) = \exp\left(\sum_i C_i \right) \exp\left( \sum_j B_j \right)$ Identifying of $Z[J] = \sum_{[n_i]} D_{[n_i]}$, $Z[0] = \exp\left(\sum_j B_j \right)$, and $W[J] = \sum_i C_i$, this reduces to $$Z[J] = Z[0]\exp(W[J])$$
4) The above gives a sense of how the $\ln Z$ comes about, but this doesn't take into account the $J$'s. Ultimately, the details come from counting $J$'s, and ensuring that the number of derivatives pulled down by the $\frac{\delta}{\delta J(*)}$'s are all accounted for, since the $Z[J]$ terms come from $$Z[J] = \int {\cal{D}} \psi \exp\left(-\frac{1}{2}\psi(*)K(*,*)\psi -V(\psi) +J(*)\psi(*)\right) = C \exp\left(-V\left( \frac{\delta}{\delta J(*)}\right)\right)\exp\left(-\frac{1}{2}J(*)K^{-1}(*,*)J(*)\right)$$
Consider some set of diagrams $C_k(x_1, x_2, ...)$ and $$W[J] = \sum_{j=0}^\infty \int dx_1 dx_2 \cdots dx_j \frac{1}{j!} C_k(x_1, x_2,... x_j)J(x_1)J(x_2)\cdots J(x_j),$$ shortened by writing the integrals in terms of '*'s: $$W[J] = \frac{1}{n!}\sum_{j=0}^\infty\frac{1}{j!} C_j(*)J^j(*),$$ and related to the correlation/Green functions such that $$Z[J] = \exp\left(W[J]\right).$$ With $J=0$, this reduces to $Z[J=0] = \exp\left(C_0\right),$ so that
$$Z[J] = Z[0]\exp\left(\sum_{k=1}^\infty \frac{1}{k!} C_k(*)J^k(*)\right) = Z[0]\sum_{n=2}^\infty \frac{1}{n!} G_n(*)J^n(*).$$ The $Z[0]$ contain loops and unconnected "vacuum bubbles" that tend to diverge. This implies $$\sum_{n=2}^\infty \frac{1}{n!} G_n(*)J^n(*) = \exp\left(\sum_{k=1}^\infty \frac{1}{k!} C_k(*)J^k\right) = \sum_{l=0}^\infty \frac{1}{l!}\left(\sum_{k=1}^\infty \frac{1}{k!} C_k(*)J^k\right)^l.$$ Then $C_1 = 0$, $G_2 = C_2$. For even $V$, $C_3 = 0$, $G_4 = C_4 + 3C_2^2$, ... The $C$'s are seen to correspond to factorable terms contributing to the diagrams. Such factors emerge in $k$ space as components that attach through a single edge - that is, cutting a single edge isolates the graphical component. Such subgraphs represent distinct factors, and can be identified from $C \exp\left(-V\left( \frac{\delta}{\delta J(*)}\right)\right)\exp\left(-\frac{1}{2}J(*)K^{-1}(*,*)J(*)\right)$ to each order in $J$. These subgraphs are called "one-particle irreducible" or 1PI diagrams.
These may be written out in terms of "exponential Bell polynomials" which may be defined in terms of the generating function $$\exp\left(u\sum_{j=0}^\infty \frac{x_j t^j}{j!}\right) = \sum_{n,k \ge 0} \frac{t^n u^k}{n!} B_{n,k}(x_1, x_2,...,x_{n-k+1}).$$ By this: $$G_n =\frac{1}{n!} \sum_{k=1}^n B_{n,k} (C_1, C_2,...,C_{n-k+1}).$$ The $B_{n,k}$ have the form
$$ B_{n,k}(C_1, C_2,...,C_{n-k+1}) = \sum_{\{j_l\}} \frac{n!}{j_1! j_2! \cdots j_{n-k+1}!} \left( \frac{C_1}{1!} \right)^{j_1} \left(\frac{C_2}{2!}\right)^{j_2} \cdots \left(\frac{C_{n-k+1}}{(n-k+1)!}\right)^{j_{n-k+1}}$$