Websites work by storing files and data on web servers, which are specialized computers connected to the Internet. When someone types a website's domain name into their web browser, the browser sends a request to the server, which then sends the website's files back to the browser to be displayed.