A table of content or outline is an hierarchical view of a document.
It resume all the sections of the document and is therefore an important part of the navigation for the reader.
They permits:
In any application, the toc can be generated at load time.
See HTML - (Document) Outline (Table of Content)