LLMs are broken in the same way. They are just predictive text generators, with no real knowledge of concepts or reasoning. As it happens most of the text it has been trained on is factual, so when it regurgitates that text it is only by happenstance, not function, that it produces facts. When it hallucinates a completely new sentence by mashing its learned texts together, it's pure chance whether the resulting sentence is truthful or not. Every generation is a hallucination. Some hallucinations happen to be sentences that reflect the truth. The LLM has no ability to tell the difference.