I've given it some thought and I've come to the conclusion that ChatGPT doesn't really execute code. It gives responses that looks like it is executing the code it generates, but it's just showing you what the response would be.