When linking to a heading, the page scrolls correctly showing the heading at the top, just below the page header. When linking to an anchor tag, the page scrolls putting the tag right at the top and doesn't consider the page header, so the tag is actually hidden by the page header. See the video in this link for more details: https://youtu.be/POZU-hnlEV8