The WWW :
First, www.example.com is an actual sub domain of example.com, even if it is most of the time defined by default exactly as the main domain.
The problem is, the domain will as well always work, so that one can always load example.com and www.example.com if nothing is done.
Here come the Search Engine Optimization matter, those two are duplicates, and worst, by default, every URL of a site will have a duplicate, because you can always keep or get rid of the www.
The www sub domain is linked to the same hosting as the domain.
Some bots do try to get rid of the www to load pages, even if they did follow a link with the www. And people can post such links too, so that in the end, if you do nothing, you are very likely to find duplicate indexing in search engines results and to end up with smaller Page Ranking.
The solution is to redirect with a 301 http header to only use one of the two.
What to choose ?
Internet is all about standard, Search Engines Bots do follow standards, or at least are built according to them. So the obvious choice here, is to always keep the www.
And it’s not only about Bots understanding this is a main domain and not a sub (thus more important ?).
Did I say standards ? www.example.com vs example.com . Which one will have more weight do you think ?
Almost every form able to auto create links will do it using a RegEx based on the www, no www, no auto active link.
One would have to post http://example.com , which you will admit is less probable.
Some sites even add the www in their sub domains, but it can become a bit long in the end, which is something to take care of as well in URLs.