It mostly learns from stuff like blog posts, articles, and stackoverflow answers. So, eventually, it understands what those commands do and what the user might expect from them. The opposite is also true, you can tell ChatGP