How do robots work?

What are robots and what are the role in SEO? Creating a robots file controls the spiders to crawl over your pages. It instructs the bots of what file or folder