"Can" is a bit of a stretch imho. It can produce something for every input. Humans are way more accurate in that regard. ChatGPT just feels correct but is mostly wrong.
It’s more that its training objective doesn’t require it to be correct, which is a completely separate thing to whether or not it can generalise to things it hasn’t seen before