setting type in px prevents browser settings from making font size adjustments (which some people definitely use) and
setting type in relative units maintains greater design fidelity as users use browser zoom (which a lot of people definitely use).
Wanna be a better web typographer?
It was once famously said that the web is 95% typography. You can't be a web designer and ignore type! Frontend Masters has an in-depth course on web typography from Jason Pamental getting into things like responsive styles, variable fonts, font loading, and more.