Search Engine Optimization Tutorial
URL Canonicalization Problem - Different URLs for the Same Page

This image shows two ways you might reach a given website's home page. Each one is a different URL.
If your site accepts both, search engines may be unsure as to which URL is the correct one to index. They may index both of them. This is serious because it splits your ranking in half. Google will look at your site as if it is two separate sites, not one.
Correcting this problem should only be done only by a qualified webmaster. Attempting to fix the problem incorrectly could shut down your entire website. You may choose having the www or not having it as your preference. It doesn't really matter which.
After the problem is corrected, your site will behave differently. Let's say you prefer having your pages served with www before your domain name. If a request comes to the server without the "www." part, whoever is requesting the page (Google, or perhaps a browser) receives a directive that says No- that page does not live here- however you can have the page starting with "www."
As a result, Google learns that all the pages on your site should include "www." and it gives full credit to all requests made thereafter. Instead of seeing your site as two separate sites competing with each other, it sees them as one.