I already read this post and I have the exact same questions. Below I pulled the first question and the answer from the post.
Therefore we still use the distribution of p for the randomly generated values x.
Computing the density, $p$, isn't the same as sampling random variables from the distribution $p$ is the density for.
My question is: why computing the density, p, isn't the same as sampling random variables from the distribution p is the density for? In my sense, if I know the pdf and all parameters of a distribution, I can randomly generate a set of x value and I can compute the probability density for each x, then we generate a random variable with a set of x values and probability density, so why do I still need rejection sampling or any other sampling methods to generate a bunch of x and its density? Maybe I misunderstand the meaning of generating random variables?