When both www and non-www versions of your pages exist, a search engine may discover each version. This may trigger a duplicate content penalty and/or split page rank, both ending in lower positions on the serps (search engine result pages).
By correctly redirecting all non-www traffic to the www version, one may prevent the problem from arising or solve the problem when it has already arisen.
Please note that while search engines sort out the new situation, a temporary loss of page rank and decline in the search engine result pages may occur.
Also note that the demonstration involves an apache server. The method may not work with sites that are hosted on other servers. Your hosting account should specify whether it concerns an apache server or not.