@yogthos @johnstonphilip Well, it doesn't do that. It's really not much better in that respect than ELIZA – the difference is, instead of just the prompt, it has gigabytes of text to work with and does so in a cleverer way. But it still has zero understanding. It's a "Chinese Room", broadly speaking.
There's plenty of information out there about how LLMs work. You might start by searching for a paper called "Stochastic Parrots".