"Humans call it "dreams"."
An AI takes millions of inputs and rehashes them into something semi-new. The same thing human brain does when sleeping. Humans call it "dreams".