Why does the SWAP operator equal a particular integral over the unitary group?

Let $$\mathcal{U}(d)$$ be the group of $$d$$-dimensional unitary matrices and $$P_{21}$$ be the swap operator ($$P_{21}$$ operators on a tensor product of Hilbert spaces $$\mathcal{H}_A$$ and $$\mathcal{H}_B$$ with the same dimension as $$P_{21} = \sum_{ij} |i\rangle\langle j|_A \otimes |j\rangle\langle i|_B$$). As an exercise to better understand the Haar measure $$\mu$$ over this group, I'd like to prove the following equality for myself: $$\int_{\mathcal{U}(d)} U\otimes U^\dagger d\mu(U) = P_{21} .$$ At 52:30 in this video, the lecturer says "if you know representation theory and how to integrate over the Haar measure, you can take the [lefthand side] expression and integrate it to get the swap."

Would someone please provide me an outline explaining how such an integral is performed?

Also, my understanding is that the existence of the Haar measure is a result from analysis. So why is the lecturer mentioning representation theory?

It's the easy part of the Peter-Weyl theorem. The orthogonality theorem for matrix representations $$g\mapsto D^J(g)$$ or $$D^K(g)$$ of any compact Lie group $$G$$ reads $$\frac{1}{ {\rm Vol}[G]}\int_G d[g] (D^J_{ij}[g])^* D^{K}_{kl}[g]= \frac{1}{{\rm dim} J} \delta^{JK} \delta_{ik}\delta_{jl} \,.$$ Here $$d[g]$$ is the Haar measure and dim$$J$$ is the dimension of the representation space. This proved by using Schur's lemma. See for example sections 14.2.2 for the discrete case and 15.2.6 for the Lie-groups case of our book (a draft copy is available online here).