Canonicalization is essential to creating an optimized website. When you create pages on your site, it can be reached from multiple urls. An easy example of how it works:
will bring users to the same page. So which version should search engines show? Robots crawl your site and read them as separate urls, causing duplicate content. They will not return all four pages so they use the one they think is the most correct/ original. In turn, each url gets its own share of search traffic and you lose out on having one powerful and well-ranked page. Luckily for SEOs, we can use 301 redirects to combine these urls- consolidating the value of your inbound links.
Note to developers: when choosing one url to receive the redirects, always use one with a trailing slash (/). Most search engines will automatically redirect say example.com to example.com/ because its inherently correct. Redirecting the reverse could cause looping issues.