I don't know for sure, but I'd imagine it's my subconscious making predictions based on context. Similar to how ChatGPT works. I bet it'd suck to play hangman with someone in a dream, because, just like those programs, they couldn't hold hi