I think that there is some degree of reasoning or logic that is naturally embedded in the words people write. So chatgpt gains something that looks like intelligence by probabilistically learning the pattern of words