Almost every answer on here is wrong for some reason, so here’s my take: originally, the WWW was to specify that it was a user accessible web page on that domain, as opposed to something used for a backend also hosted on Google.com, for example. Here’s how web addresses work: they go backwards. You can think of .com as a folder, with domains in it like Google.com and reddit.com. then, inside those lie more specific servers, like classroom.google.com or sites.google.com. At some point, it became less necessary to have your website on the www portion of your domain, and some websites just host it on the domain name itself (Twitter, for example). Checking which one a specific web page uses is handled by your browser, which redirects you to the correct address if you forgot the www (but not the other way around, at least sometimes)
Latest Answers