I am coming across similar thing in many problems in econometrics and I have not been able to figure out whether it is some general notion or only a "coincidence".
To take two examples:
Deriving Ordinary Least Squares estimator $$Y = X\beta + \epsilon\\ E(Y\mid X) = E(X\beta\mid X) + E(\epsilon\mid X) \\ X'Y = X'X\hat{\beta}$$ The last term on the second row is by assumption zero.
Deriving Instrumental Variables estimator $$Y = X\beta + \epsilon\\ E(Y\mid Z) = E(X\beta\mid Z) + E(\epsilon\mid Z) \\ Z'Y = Z'X\hat{\beta}$$ Again, the last term on the second row is by assumption zero.
So, my question is: How firm is the relationship $E( \cdot \mid X) = X'(\cdot)$? How is it connected to linear algebra? Thx.