The attributes’ values are based on the titles’ contents, so identical titles will have identical id and data-d-toc attributes:
Last “Aim” title:
Leads to the first Aim which has an id and data-d-toc attributes whose value is the same as the last ToC element:

