TL;DR
hreflang tags or attributes are used to communicate to search engines the language used within a content page and to showcase variations of content based on users' locations.
What is the hreflang tag?
The hreflang tag, also referred to as hreflang attribute, is used to communicate to search engines what language a website uses on specific pages. This helps crawlers and search engines index the content properly and display it as a result in the search engine page results for people searching in that language.
To easily add (or identify) a hreflang tag in a page, use rel="alternate" hreflang="x". Here's a code sample for 2 variations of English on the same site:
<link rel="alternate" href="https://yourwebsite.com" hreflang="en-us" />
<link rel="alternate" href="https://yourwebsite.com" hreflang="en-uk" />