A canonical URL represents the URL of the page that Google thinks is most representative from a set of duplicate pages on your site, or even pages with minor changes in filtering.
There are various solid grounds to have different URLs that point to the same page or to very similar pages at different URLs, such as:
Example of similar URLs pointing to the same page through dynamic URLs:
This use-case is similar for other filtering options as well, or for blogs with posts under multiple categories.
Supporting various device types:
Having the same content for http vs. https variants, www vs. non-www or even links like yourwebsite.com/ vs. yourwebsite.com
Duplicate content has a negative impact on the website's ranking and having the same page accessible through multiple links, even though it is for filtering or device type reasons, Google still sees them as duplicate versions of the same page. Once the crawlers identify multiple pages pointing to the same page, they will choose a single URL as the canonical version and crawl it, and all other URLs will be considered duplicates and crawled less (or it can even lead to penalties)