Some text editors (e.g. MS Word, or Atlassian Confluence Wiki editor) make it trivial to add a table of contents to a text that was properly formatted (e.g. has headings/chapter titles), by merely doing a single "insert table of contents" operation, as opposed to manually creating all the links - and the TOC can be easily refreshed as the text structure changes.
Is there such a capability for EPUB books?
Is there a TOC concept in the format specification itself?
If so, does at least one popular EPUB editing software support that concept, including refreshing TOC to reflect text structure changes?