Could someone explain to me why the following equation holds? It is related to the law of total probability , but I don't get it. I'm confused because it's two random variables on the right side and therefore it should also be a joint distribution, right ?
$$\begin{align} \int \limits_0^\infty f_X(x) \ \mathbb{P}(Y<x) \ dx &= \mathbb{P}(Y<X) \end{align}$$
I understand that $$\begin{align} \mathbb{P}(X \in A, Y \in B) = \int_B f_Y(y) \int_A f_X(x|Y = y) \ dx \ dy . \end{align}$$
But how do I put this together?