If the wavefunction describing the state of a hydrogen atom can be written as the product of two functions $R(r)$ and $Y(\theta, \phi)$:
$\psi_{nlm} = R_{nl}Y_{lm}$
then the probability density function is:
$P(r)dr = R_{nl}^2 r^2 dr$
However why is that the case? Shouldn't the probablity density also depend on $\theta$ and $\phi$? What is the derivation of this result?
The probability density by volume is given by $$P(r,\theta,\phi)dV=\psi_{nlm}\psi^*_{nlm}dV$$ Here $dV$ is the volume element. In spherical coordinates $dV=r^2 dr\sin\theta d\theta d\phi$. You can therefore separate the probability into a radial part, and an angular part $$P(r,\theta,\phi)dV=P_{radial}(r)r^2dr\times P_{angular}(\theta,\phi)\sin\theta d\theta d\phi$$
You can now plug in the first formula into this last equation and you get $$P(r,\theta,\phi)dV=\psi_{nlm}\psi^*_{nlm}dV=R_{nl}^2(r)|Y_{lm}(\theta,\phi)|^2dV=R_{nl}^2(r)r^2 dr\times|Y_{lm}(\theta,\phi)|^2\sin\theta d\theta d\phi$$
Note that in the last part, you can separate the radial part from the angular part. The full probability is still angle dependent, but you can ignore that, since all they ask is the radial part. When you integrate the angular part, you get a constant $(4\pi)$. You can now use the radial part to answer questions like: "what is the most probable distance from the center?" or "what's the average proton-electron distance?"