SEO works by improving a website's visibility in search engines like Google, Yahoo and Bing. It does this by optimizing the website's content, structure and code to ensure that it is both relevant to the search query and well-structured for the search engine to easily index. This helps the website to appear higher on the search engine's results pages, making it easier for users to find the website.