The examiner cites the reveferences that come closest to describing the claimed invention. Sometimes, but not always, the examiner cites additional references that show the state of the art and do not seem to overlap with the claims in the patent application. The inventor and examiner then carry on correspondence during which they debate whether the invention is or is not patentable in view of the references cited. The cited references are handled differently by different patent offices. The EPO and WIPO publish a search report 18-months after the priority filing date.
Patent examiners have no responsibility for evaluating the quality of the references they cite.
They are simply guarding the public against the grant of patents that are already in the public domain. They are only required to cite the best references they can find - a single reference that anticipates the claims is the most desirable situation. Let me give a hypothetical example. Let's say I am an examiner doing a search on a patent application that claims a combination of aspirin and phenobarbitol. I read some of the references and find one that suggests administering the two drugs at the same time.