What problem it solves
Duplicate URLs are everywhere: tracking parameters (?utm_source=), session IDs, http vs https, trailing slashes, and printer-friendly views. Without guidance, Google may index the wrong variant or dilute your authority across all of them. A canonical points every duplicate at the single URL you want ranked.