Headlines are exported to ‘<h1>’, ‘<h2>’, etc. Each headline gets the ‘id’ attribute from ‘CUSTOM_ID’ property, or a unique generated value, see Internal Links.
Headlines can contain a link to themselves. To enable it, you can:
org-html-self-link-headlines to a non-nil value
html-self-link-headlines option
#+OPTIONS: html-self-link-headlines:t
When enabled, the text of the headlines is wrapped in ‘<a>’ tags. These tags have a ‘href’ attribute making the headlines link to themselves.