How is html not data?
It's similar to a modern web app talking to a REST API to get raw data in JSON form and then using that data in some user-friendly rendered web page. Except it's a standard that anyone can use, instead of everyone rolling their own client-side browser code.
Of course, XML is so complicated that it fell out of favour, but that was the idea.