ChatGPT doesn't "understand" in the way we define understand. It is a highly sophisticated pattern recognition engine for natural language. It has memorized the probabilistic relationships between words that humans express in language.