I am trying to understand the derivation of expected loss (equation 2.11 in Elements of Statistical learning) and there is a specific step I do not understand.
We start with
$EPE(f) = E(Y - f(x))^{2}$
and I understand the derivation up to:
$\int_{x} E_{Y \lvert X}(L(x,y)) p(x) dx$
(all omitted steps can be seen here Confused by Derivation of Regression Function)
However, I do not understand how the above is equivalent to:
$E_{X}E_{Y \vert X}L(x,y)$
Why are we multiplying $E_{X}$ by $E_{Y \vert X}$. Where does $E_{X}$ come from? What probability rule/theorem is responsible for this?