W3C: Why can't we just have <includes src="./header.html"> and be done with it?
Nice idea!
https://web.dev/articles/imports
Been there, tried that.
Introduced in 2014 (Chrome 36) Deprecated 2018 (Chrome 70) Retired 2019 (Chrome 73)
You might be interested in https://github.com/WICG/declarative-partial-updates
In the old days, we used to emulate this with a <script> tag that did a document.write ... yes, very hacky.
Can I introduce you to iframes? Clunky but they do exactly what you are asking for.
SGML (ISO 8879), the markup meta-language on which HTML is based, has that, as well as many other things, such as type-checked templating.
Hence HTML as a mere vocabulary making use of SGML's facilities didn't need to define its own ad-hoc mechanism.
Btw the <?php ...> construct is also derived from SGML. In SGML terms it's a "processing instruction" rather than an "entity reference", the latter being the basic means for content inclusion.