In general, headers like <h1>, <h2> and etc. are used to represent the structure of a document.
In concept, these tags are similar to the styles “header1” and etc. in Microsoft Word (and other word processors). On the surface, they are only used to highlight text using boldface, italic and underline.
However, text specified in header styles (tags) also have special meanings to applications programs. In the case of Microsoft Word and other word processing applications, the text specified in header styles can be collected into a table-of-content (TOC). In other words, the proper use of header styles makes it possible for a word processor to automatically generate tables of contents.
In the case of an ordinary web browser, the special role of header tags is not obvious.