Definition: Suppose we are in the probability space $ (\Omega,\mathcal{F},\mathbb{P})$. Let $ \mathcal{G} \subset \mathcal{F}$ a sub $\sigma$-algebra and let $X$ be an integrable random variable then there exists a unique $Z$ $\mathcal{G}$-mesurable and integrable such that for every bounded random variable $U$:
$$ E[XU]=E[ZU] $$ We define $Z=E[X|\mathcal{G}]$ the conditional expectation of X with respect to $\mathcal{G}$.
I don't get why we write this expression $E[XU]=E[ZU]$ and I also don't get why are we able to define $Z=E[X|\mathcal{G}]$ given that first expression?
(I translated the definition from French so sorry if it's not well-formed.)