The Table of Contents macro scans the headings on the current Confluence page to create a table of contents based on those headings. This helps readers find their way around lengthy pages, by summarizing the content structure and providing links to headings.
The Table of Contents macro has several options. One of the options is to enabled Display Section Numbering. When you use Numbered Headings on the page, you need to make sure to disable Display Section Numbering, in order to prevent double numbering.