We define the conditional expectation of a random variable $X$ on a given probability space $(\Omega,\mathscr F, P) $ w.r.t a sub $\sigma$-algebra $\mathscr G$ is a random variable denoted by $E[X|\mathscr G]$ defined as random variable that satisfies the following condition
$\int_{A}E[X|\mathscr{G}] \hspace{0.1 cm}dP = \int_A X\hspace{0.1 cm}dP \hspace{0.3 cm}\text{for all } A \in \mathscr{G}$
But we know that if $X_1$ and $X_2$ are two random variables satisfying the condition that
$\int_{A}X_1 \hspace{0.1 cm}dP = \int_A X_2\hspace{0.1 cm}dP \hspace{0.3 cm}\text{for all } A \in \mathscr{G}$, then $X_1 = X_2$ a.s.
Therefore for the conditonal expectation defined as above, we conclude that $E[X|\mathscr G] = X$ a.s. Then what is the major difference between $E[X|\mathscr G]$ and $X$?