Canonical URLs are one of the most vital parts of good SEO practices. Duplicate content is a major issue for SEO, and has a negative impact on your search results.
Duplicate content makes it difficult for search engines to effectively index your site. It makes it hard for engines to know which version of a page to index and rank for search queries.
Effective use of canonical URL tags eliminates these problems. If left alone, Google and other engines will make these decisions for you. This can lead to versions of pages being indexed and ranked that are not the ones you want.
By specifying this with a canonical tag, you bypass this issue altogether. Using these tags allows you to know exactly which parts of your site are being given priority, making it easier to plan your SEO strategy.
This is especially important for websites that can have multiple versions of the same page. Online marketplaces or other sites where users can log in or set filters have this issue the most.
For example, if an online marketplace lets users filter by type of content, that creates duplicate pages. Each version of that page may look the same, but the URLs will all be slightly different, as they include tags to control the filter.
Google will look at all of those since they index URLs rather than pages. This creates a problem, because now any of these filtered pages can be indexed by Google for your search results.
This is very bad for SEO, because it clutters your presence in the search results. It also makes it much harder for Google to know which version of your page to index, and where to rank it in searches.
By adding canonical tags, you can avoid this issue altogether. Google will know exactly which version of the page is the main one, and will index that URL for its search results.