There is yet one more perspective on the relation between $G$-Chern-Simons theory and the WZW-model on $G$: the background B-field of the latter can be regarded as being the prequantum circle 2-bundle in codimension 2 for a "higher/extended geometric quantization" of Chern-Simons theory.
This is spelled out a bit at
nLab:Chern-Simons theory -- Geometirc quantization -- In higher codimension.
In brief the story is this:
We have constructed in Cech cocycles for differential characteristic classes a refinement of the generator of $H^4(B G, \mathbb{Z})$ to a morphism of smooth moduli $\infty$-stacks $\mathbf{c}_c : \mathbf{B}G_c \to \mathbf{B}^3 U(1)_c$ from that of $G$-principal bundles with connection to that of circle 3-bundles (bundle 2-gerbes) with connection
(for $G$ a simple, simply connected Lie group).
This is such that when transgressed to the mapping $\infty$-stack from a closed compact oriented 3d manifold $\Sigma_3$ it yields the Chern-Simons action functional
$$
\exp(2 \pi i \int_{\Sigma_3} [\Sigma_3, \mathbf{c}_{conn}])
:
CSFields(\Sigma_3) = [\Sigma_3, \mathbf{B}G_{conn}] \to U(1)
\,.
$$
But one can similarly transgress to mapping stacks out of a $0 \leq k \leq 3$-dimensional manifold $\Sigma_k$. For $k = 1$ with $\Sigma_1 = S^1$ one obtains a canonical circle 2-bundle (circle bundle gerbe) with connection on the smooth moduli stack of $G$-principal connections on the circle
$$
\exp(2 \pi i \int_{S^1} [S^1, \mathbf{c}_{conn}])
:
[\Sigma_1, \mathbf{B}G_{conn}] \to \mathbf{B}^2 U(1)
\,.
$$
Now since $\mathbf{B}$ is "categorical delooping" while $[S^1, -]$ is "geometric looping", the mapping stack on the left if not quite equivalent to $G$ itself, but it receives a canonical map from it
$$
\bar \nabla_{can} :
G \to [S^1, \mathbf{B}G_{conn}]
\,.
$$
In fact, the internal hom adjunct of this map is a canonical $G$-principal connection $\nabla_{can}$ on $S^1 \times G$, and this is precisely that from def. 3.3 of the article by Carey et al that Konrad mentions in his reply.
So the composite
$G \to [S^1, \mathbf{B}G_{conn}] \stackrel{transgression}{\to} \mathbf{B}^2 U(1)_{conn}$
is thw WZW circle 2-bundle on $G$, or equivalently the Chern-Simons prequantum circle 2-bundle in codimension 2.
(The math parser here gets confused when I type in the full formulas. But you can find them at the above link).
This post imported from StackExchange MathOverflow at 2014-12-26 15:19 (UTC), posted by SE-user Urs Schreiber