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$?
Let $$\mathbb P(X=1) = \mathbb P(X=-1)=\frac12, $$ $Y=2X$, and $$\mathbb P(W=1) = \mathbb P(W=0)=\frac12, $$ with $W$ and $X$ independent. Then $$\mathbb E[X\mid\sigma(W)]=\mathbb E[X] = 0,\quad E[Y\mid\sigma(W)]=\mathbb E[Y] = 0\ a.s. $$ so for any $A\in\sigma(W)$, $$\mathbb E[\mathbb E[X\mathsf \mid\sigma(W)]1_A] = \mathbb E[\mathbb E[X]\mathsf 1_A]=\mathbb E[X]\mathbb P(A)=0$$ and similarly for $Y$. But $\mathbb P(X\ne Y)=1$, so clearly $X\ne Y$ a.s.