A canonical tag is a link element with rel set to canonical, pointing at the address you want treated as the main version of a page. Search engines read it as a strong hint, not a command, and use it to decide which URL to index and show when duplicates exist.
Duplicates appear more easily than people expect: tracking parameters on URLs, http and https versions, a trailing slash or not, printer-friendly copies, or the same product under several categories. A canonical tag consolidates these so signals are not split. Most pages should also carry a canonical pointing to themselves, which guards against stray variants.
The common mistake is confusing it with other tools. It does not block crawling like robots.txt, it does not keep a page out of search like noindex, and it does not send visitors anywhere like a 301 redirect. A wrong canonical can quietly remove a good page from results. Example: an article reachable at /post and /post?utm_source=newsletter should have both versions pointing to /post, so Google treats them as one page.
Related: duplicate content, noindex, robots.txt, 301 redirect, indexing