The DOM (Document Object Model) is the in-memory tree the browser builds from HTML, plus the API scripts use to read and change it. The WHATWG DOM Standard defines the tree and its generic interfaces; the HTML Standard defines the HTML element classes on top.
Node is the base interface for everything in the tree. Every node has a primary type, reported by nodeType:
Document(9): the root, exposed asdocument.DocumentType(10): the<!doctype html>.Element(1): a tag.Text(3) andComment(8), bothCharacterData: leaves that hold a string.DocumentFragment(11): a parentless container for building subtrees. A shadow root is one too.Attr(2) is aNodefor historical reasons, but it never has a parent: attributes hang off their element, not the tree.
The standard constrains the shape. A document has at most one doctype and one element child, <html>, which is document.documentElement. Elements contain elements and character data.
Element vs HTMLElement. Element holds what every markup element shares: attributes, id, classList, selectors. HTMLElement adds HTML-only features such as hidden, title and click(), and each tag gets a subclass: <p> is HTMLParagraphElement. SVG elements are Elements but not HTMLElements. An unrecognised name such as <foo> becomes HTMLUnknownElement; a valid custom element name such as <x-foo> gets plain HTMLElement, so a later upgrade only extends the chain.
Node vs element APIs. Node-level APIs (childNodes, firstChild, parentNode) include text and comments; element-level ones (children, firstElementChild, parentElement) skip them. That's why whitespace between tags shows up as #text nodes in childNodes but not in children.