This built in option under the Table of Contents lets the user add an automatic table that includes all text formatted with the Heading 1-3 Styles

Question 2 options:

Automatic Table 1

Automatic Table 2

Manual Table

Custom Table of Contents

Automatic Table 1