I'm learning about MCMC as it relates to Bayesian networks. As far as I can tell, MCMC operates with rejection sampling, but also updates the posterior distribution of the target variable in the network.
My question is: in which conditions do the sampled values at the end of the network update the posterior? Do the rejected samples also update the posterior distribution? Or are only the accepted samples used to update the posterior? Also, what is the acceptance/rejection criteria of these networks (if it depends on the network please let me know what common criteria are used).
If my question hints at a lack of understanding please correct me. Also if there are any helpful resources on the technical points in this process please let me know.
Thanks!