HREF-LANG tags are used to show a web crawler what a URLs target audience is from a language & location standpoint.
Tags are meant to serve as a way to tell search engines that a specific page is meant to be served to an audience in a certain country & in a certain language.
Tags can be used across pages for multiple languages in the same country, on each’s respective URL.
How HREF-LANG Tags Improve International SEO
Sites that offer products & services to a global audience will use different pages to show translations of the same information found on a page for a different target audience.
When doing this, it is not always clear where to serve content, especially if one version of the page is particularly stronger than another.
HREF-LANG tags serve as somewhat of a canonical tag, in that they say that URL-A is the same as URL-B, except that it is intended for users who speak Language Y in Country Z.
This helps clear up issues around where pages are rendering, which can be particularly annoying for countries such as US, Canada & UK who all speak the same language, but may be expecting a different style of writing or different more localized content based on local laws & regulations.
They are another form of directive to show what piece of content belongs rendering where, which helps to avoid cannibalization by other, pieces of content that are less relevant to the locally targeted audience.