What a canonical tag does
The canonical tag (<link rel="canonical" href="…">) tells search engines which address is the main version of a page. It matters when the same content can be reached at several addresses, like with tracking parameters, with and without a trailing slash, or on http and https.
Common canonical mistakes
Pointing every page to the homepage, pointing to a page that redirects or returns an error, having two different canonical tags, or a relative address that resolves somewhere unexpected. Any of these can make Google ignore the page you want to rank.
Most pages should have a canonical that points to themselves.