I have a bunch of iid random variables $X_i\sim q$ and I have defined other random variables $A_i = a(X_i)$ and $B_i = b(X_i)$. Then I bumped into the following expression $$ \begin{align} \mathbb{E}\left[\left(\frac{1}{N}\sum_{i=1}^N A_i\right)\left(\frac{1}{N}\sum_{i=1}^N B_i\right)\right] &= \frac{1}{N^2}\mathbb{E}\left[\sum_{i=1}^N \sum_{j=1}^N A_i B_j\right] \\ &= \frac{1}{N^2}\sum_{i=1}^N \sum_{j=1}^N \mathbb{E}[A_i B_j] \end{align} $$
What does $\mathbb{E}[A_i B_j]$ mean here?
It seems like a stupid question, but it's not clear to me what it represents. I tried to write it out as an integral but without success. I don't understand what distribution it is with respect to. Is it this? $$ \mathbb{E}[A_i B_j] = \int\int a(x) b(y) q(dx) q(dy). $$ Surely, this cannot be correct, otherwise it would mean $\mathbb{E}[A_i B_j] = \mathbb{E}[A]\mathbb{E}[B]$, which would lead to $$ \mathbb{E}[\bar{A}\bar{B}] = \mathbb{E}[A]\mathbb{E}[B], $$ where $\bar{A}$ and $\bar{B}$ are the sample averages above, and this cannot be true.
Additional Details
Given a probability space $(\Omega, \mathcal{F}, \mathbb{P})$ and a measurable space $(E, \mathcal{E})$ a random variable is a measurable function $X:\Omega\to E$. Expectations of this random variables are $$ \mathbb{E}[X] = \int_{\Omega} X(\omega) \mathbb{P}(d\omega). $$ Given another random variable $Y$ on $(\Omega, \mathcal{F}, \mathbb{P})$ we know that $\mathbb{E}[XY]\neq \mathbb{E}[X]\mathbb{E}[Y]$ except when $X$ and $Y$ are independent. However, I don't see how $\mathbb{E}[XY]$ can ever be different from $\mathbb{E}[X]\mathbb{E}[Y]$. Indeed I could define $Z(\omega, \omega') = X(\omega) Y(\omega')$ as a random variable on $(\Omega\times\Omega, \mathcal{F}\otimes\mathcal{F}, \mathbb{P}\otimes \mathbb{P})$ and its expectation would be defined as $$ \begin{align} \mathbb{E}[Z] &= \int_{\Omega\times\Omega} Z(\omega, \omega') \mathbb{P}(d\omega)\mathbb{P}(d\omega') \\ &= \int_\Omega \int_\Omega X(\omega) Y(\omega') \mathbb{P}(d\omega)\mathbb{P}(d\omega') \\ &= \left[\int_\Omega X(\omega) \mathbb{P}(d\omega)\right]\left[\int_\Omega Y(\omega') \mathbb{P}(d\omega')\right] \\ &= \mathbb{E}[X]\mathbb{E}[Y]. \end{align} $$ Now, in the context of my main question, what would $\mathbb{E}[A_i B_j]$ be? I want to write it down as an integral but I am struggling to do so. Especially because $a(X_i)$ and $b(X_i)$ are functions of the same underlying random variables.