You can consider the tower rule for intuition on why this can be true:
E[X] = E[E[X|Y]]
Essentially, what's happening is that, in E[X|Y], we first "hold" the randomness of Y, then consider the expected value of X for every possible value of Y. Once this is determined, we then take the expectation over all values of Y, which integrates out its effects, leaving us with the expected value of X.
This rule is similar, and arises from the tower rule above.
This rule is similar, and arises from the tower rule above.