Confusing to me how Var[Y] can be computed only from terms that are conditional on X ... surely its marginal variance has components arising from variance outside its distribution that is conditional on X? (or is that a typo ....)
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.