I think you’re 100% correct in assuming they’ve already fed it data scraped from SO. I’ve previously gotten code samples from ChatGPT that was clearly from SO down to the comments in the code. Even reverse searched some of the code and found the question it was from.