The DOM is just a representation of the HTML document.
There's a great explanation in the MDN Web Docs:
The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects. That way, programming languages can connect to the page.
For more information, I recommend reading the full Introduction to the DOM in the MDN Web Docs. 😊