I bet if the font size was given in pt instead of px it would be mostly constant. Because you need a minimum physical size of the letters to be able to read them (like the test at the optometrist).
As you get bigger resolution on standard sized (computer) screens, increasing px gives you the same physical size of the letters with more and more detail around the edges etc.
I have the impression that it's more than that. Many websites these days allow me to see less text at a time on a 27 inch monitor then I had 35 years ago on a 14 inch monitor. More and more websites look like those books for very young children, with text and line spacing so large that only a few paragraphs (or sometimes not even that) fit on the screen.
For CSS, both px and pt are (supposed to be) physical sizes: 1 px = 0.75 pt
1 px = 1 pixel was the original intention but has not been true for a long time now.
The problem is that some people use HDPI screens without (adequate) display scaling - likely to recover screen space from existing bloated desings - and then base their own designs on that. So neither px nor pt end up referring to physical sizes in practice.
As you get bigger resolution on standard sized (computer) screens, increasing px gives you the same physical size of the letters with more and more detail around the edges etc.