A web page was never a document
The tree was always there. Only who edits it has changed.
People keep saying a web page is a document and it isn’t. It never was.
Go back as far as you like. Even when sites were static things the browser rendered once and then left alone, there was always a tree of nodes sitting underneath. That’s what the browser built and that’s what it drew from. The markup was never the page. It was a way of describing what the tree should look like before anything else happened to it and the browser threw the text away the moment it had what it needed.
What’s changed in three decades isn’t the tree. It’s that we now ship a small application alongside it that lets the user change the tree while they’re looking at it. That’s the whole difference and it’s a difference in who gets to edit rather than in what the thing fundamentally is. HTML is still just how we describe the starting state and you could argue it’s the wrong language for that job but that’s a separate argument.
This matters because of what follows from it. If you think of a page as a document then the markup you serve is the thing and anything that reads the web can expect to find what you sent. If you understand it as a tree with an application attached, then what you served is a starting position and you can’t expect it to still be there a second later. Software that consumes the web has to deal with that and quite a lot of it still doesn’t.
None of which is an argument against semantic markup. That’s still important for accessibility and for the machines that read pages without running them and getting it right is a real skill that’s worth having. It just doesn’t buy you the guarantee people think it does because the thing you carefully described is the initial state of something the page is about to start modifying.
If you’re old enough you’ll remember that HTML used to carry the visual description too. There were no stylesheets. We had font tags and color attributes and spacer gifs and we used them because there was nothing else. Then we stopped because it was awful and the visual description moved out into its own language where it belonged.
The same thing has been happening to the rest of it. Users wanted interactivity and they got exactly that and browsers turned into things that run small applications rather than things that render markup. The shift crept up slowly enough that people carried on describing the web the old way without ever noticing the description had quietly expired.
So thinking of the web as HTML pages is just out of date. Not wrong in some pedantic technical sense but out of date in the way that describing a phone as a thing you make calls on is out of date. It’s still true and it stopped being the useful description a long time ago.
Static content hasn’t gone anywhere and it’s still the right answer for a great many things, probably a good deal more of them than the industry currently believes when it reaches for a framework on the first day of a project. That isn’t the point. The point is that even your static page was always a tree and the tree is the part that was real the whole time.
The reason it’s worth getting right is that the wrong model produces bad decisions further down. If you believe you’re publishing documents then a crawler reading your markup is seeing your site, an accessibility tool reading your markup is seeing your site, and anything that disagrees with that is broken software you can safely ignore. If you understand that you’re publishing a starting state for a program, then all of those tools are reading a snapshot of something that has already moved on, and the gap between what you sent and what the user is looking at becomes your problem rather than theirs.
That’s a much less comfortable position and it’s the one we’ve actually been in since roughly the point browsers stopped being renderers.