Because that text is so massive, you're bound to get some interesting and even accurate results for most queries, but don't mistake that for intelligence. It doesn't "understand" anything, it just compares weights internally and spits out the most probable result depending on what you asked for.
This is why ChatGPT fails the moment you ask it for domain-specific stuff that requires a bit of flexibility in interpreting it or why it produces subtle errors and presents it as functional with complete overconfidence.
To be clear, it's not useless[0], but the actual usefulness of ChatGPT as a disrupting thing is far overstated insofar as a Skynet nightmare scenario goes.
[0]: Although I'd still caution with using it to solve programming problems or similar such until any pending copyright matters have resolved, given its also willing to spit out licensed code and that can be a legal disaster.