What canonical tags actually do
A canonical tag is one line of HTML — <link rel="canonical" href="…"> — that tells Google which URL it should treat as the primary version when several URLs serve the same content. It's the single most powerful signal you have for consolidating duplicate-URL situations: query strings, trailing-slash variants, http/https mixes, paginated archives, and printable variants.
Without canonicals, Google has to pick one URL itself, and its choice may not be the version you want indexed. Worse, link equity gets split across the variants. A correct canonical keeps the equity consolidated on one URL and the others quietly drop out of the index.