In one sentence
robots.txt is a text file placed at the entrance of a website (/robots.txt) that instructs crawlers (search-engine crawl bots and AI crawlers) on "where they may look."
What does this look like in practice?
For example, if your site's /robots.txt contains:
User-agent: GPTBot
Allow: /
User-agent: Claude-Web
Allow: /
User-agent: Google-Extended
Allow: /
Sitemap: https://example.com/sitemap.xml
then crawlers from ChatGPT / Claude / Gemini understand "ah, we may look at the entire site" and proceed to crawl.