The browser has given h2 tags (and other tags) a font size of some rem, so that it will change size when the font size of the root element changes.
Let's say the browser sets the default root element font size for h2 to 1.5rem, for example. Now you change it to 1rem, so it of course gets smaller.