ChatGPT was trained on large text datasets and used its algorithms to generate responses based on that information. It does not require internet access because it works offline and does not rely on real-time data.