The canonical tag is a technical indicator in a website’s source code that designates one of several identical or similar pages as the preferred version when the search engine needs to determine which one is authoritative.
This is because pages with the same or nearly the same content often arise unintentionally—for example, due to filter and sorting parameters in online stores, URLs with and without suffixes, or print previews. Without a clear instruction to the search engine, it must decide on its own which version to rank and display in search results.
The canonical tag provides the search engine with a clear recommendation for this purpose.