From a rigorous perspective, why does Monte Carlo work? In physics, you often set up a Markov chain with transitional probabilities $p_{ab}$ ($a,b$ are possible states) such that it satisfies the "detailed balance condition", i.e., $\pi_a p_{ab} = \pi_b p_{ba}$ where $\pi_a$ the desired measure/distribution. I understand that the detailed balance guarantees that the desired measure $\pi$ is stationary with respect to the transition probabilities, $p_{ab}$, but why exactly does the $n$th step $X_n \rightarrow \pi$ in distribution?
Basically, what I'm asking is the asymptotic behavior of Markov chains and the relation to Monte Carlo. I would appreciate some references that go into the rigor of the formulation.
EDIT: I realized that in practice, we generate Markov chains using a process called rejection sampling.