role="treeitem" nodes nest inside role="tree", and any node with children groups them under role="group". Each node carries aria-expanded (open or not) and aria-level (indentation depth). Right arrow conventionally expands or moves into children; left arrow collapses or moves to the parent.
It differs from an accordion in nesting depth — an accordion usually toggles single-level sections, while a tree view is recursive, like a file explorer where folders can sit inside folders to any depth.
A tree with checkboxes (a permissions editor, say) reuses the indeterminate pattern from the checkbox entry — a parent node shows a dash when only some of its children are checked.