A canonical URL is an authoritatively correct URL for a resource. Canonicalization is the process of selecting the best URL for your website.
For example:
www.example.com
example.com
Although these are URLs pointing to same home page, but all of these URLs are different. A web server sees these two unique URLs as two unique pages.To make sure the search engines are indexing the correct page, you need to select which variation of the URL you want to set as a canonical URL or canonicalized URL.