The World Wide Web (www) was invented after the internet. By then, the internet used to be mainly used for emails, file transfers between universities, and remote-terminals. When the “web” came along, people bolted a webserver to their domain and made it accessible at the www subdomain, as a convention to signify a publicly accessible web portal.