Let's first recall the case of finite groups $G$. A projective representation of $G$ is a homomorphism $\rho : G \to PGL_n(\mathbb{C})$. In trying to lift this to a genuine representation $G \to GL_n(\mathbb{C})$ we find an obstruction given by a class $c \in H^2(BG, \mathbb{C}^{\times})$. An invariant way to describe this obstruction is that the short exact sequence
$$1 \to \mathbb{C}^{\times} \to GL_n(\mathbb{C}) \to PGL_n(\mathbb{C}) \to 1$$
gives rise to a coefficient exact sequence ending
$$\cdots \to H^1(BG, GL_n(\mathbb{C})) \to H^1(BG, PGL_n(\mathbb{C})) \to H^2(BG, \mathbb{C}^{\times})$$
(where every group involved has the discrete topology). The class $c$ can be thought of as the level of the projective representation $\rho$.
If $G$ is perfect, meaning that $G/[G, G] \cong H_1(BG, \mathbb{Z})$ vanishes, then universal coefficients gives an identification
$$H^2(BG, \mathbb{C}^{\times}) \cong \text{Hom}(H_2(BG, \mathbb{Z}), \mathbb{C}^{\times})$$
and we can equivalently think about levels as follows: $G$ admits a universal central extension
$$1 \to H_2(BG, \mathbb{Z}) \to \widetilde{G} \to G \to 1$$
and we can identify projective representations of $G$ of level $c$ with ordinary representations of $\widetilde{G}$ where the central $H_2(BG, \mathbb{Z})$ acts by the character in $\text{Hom}(H_2(BG, \mathbb{Z}), \mathbb{C}^{\times})$ corresponding to $c$. In particular, by Schur's lemma, every irreducible representation of $\widetilde{G}$ has a well-defined level.
A similar but more complicated thing is happening in the case of loop groups, although I can't claim to know the details. Here is a guess at the details. With suitable hypotheses on a Lie group $G$, the loop group $LG$ should admit a universal central extension
$$1 \to S^1 \to \widetilde{LG} \to LG \to 1$$
and we should be able to think of projective representations of $LG$ in terms of representations of $\widetilde{LG}$ (I am ignoring the energy circle here) where the central $S^1$ acts by a fixed character; moreover, these characters should be identified with levels in a cohomological sense as above.
The identification should go something like this: given a level $k \in H^4(BG, \mathbb{Z})$ we can think of it as a class in $H^3(BG, \mathbb{C}^{\times})$ (where $\mathbb{C}^{\times}$ now has the usual topology) and then transgress it to a class in $H^2(LBG, \mathbb{C}^{\times})$. The group I actually wanted to land in is $H^2(BLG, \mathbb{C}^{\times})$, which at least looks like it has something to do with projective representations of $LG$, but in fact
$$\Omega LBG \cong L \Omega BG \cong LG$$
so $LBG \cong BLG$ as long as $LBG$ is connected, which should be ensured by $G$ being connected.
If $G$ is compact, simple, connected, and simply connected, then it's well-known that $\pi_2(G) \cong \pi_3(BG) \cong H_3(BG, \mathbb{Z})$ vanishes and that $\pi_3(G) \cong \pi_4(BG) \cong H_4(BG, \mathbb{Z}) \cong \mathbb{Z}$. Universal coefficients now gives an identification
$$H^4(BG, \mathbb{Z}) \cong \text{Hom}(H_4(BG, \mathbb{Z}), \mathbb{Z}) \cong \mathbb{Z}$$
which gets identified above with characters of the central $S^1$, although I'm not sure how; there should be some nice functorial description of this $S^1$ but I'm not sure what it is.