To explain it as briefly as possible, a canonical URL is the URL of some page on the site that Google thinks is most representative from a set of duplicate pages that also exist there. For example, if you have more URLs for the same page, algorithms will choose the most representive ones and decide that that will be the main URL of that specific page.