MediaWiki:Visualeditor-dialog-meta-settings-toc-help/en

You can force a table of contents that lists each heading on the page to appear on pages with fewer than three headings, or force it to not appear at all. By default, it will appear if the page has three or more headings.