Trees Are Just Graphs With Rules
A family tree, a file system, and a company org chart are all the same shape: one graph, with the rule that nothing ever connects back to where it came from.
A family tree is a familiar picture: one person (or couple) at the top, their children below them, their children's children below that. It turns out that picture is a graph — people are nodes, parent-child relationships are edges — with two extra rules layered on top: there's exactly one node with no parent (the root), and following edges downward never leads back to a node you already visited.
Those two rules are the entire definition of a tree in computer science, and they're what separates a tree from a graph in general. A graph can have cycles (a path that loops back on itself), multiple disconnected clusters, or nodes with no clear "top." A tree can't — every node except the root has exactly one parent above it, and there's never a way to follow connections in a loop back to where you started, exactly the same shape as a real family tree, where you're never your own ancestor.
This restricted, no-loops shape is why trees show up as the backbone of so much everyday software. A computer's file system is a tree: a folder can contain other folders and files, each of which has exactly one parent folder, and there's no way for a folder to end up nested inside its own subfolder. An organization chart is a tree: every employee has exactly one manager (excluding the top), and the reporting structure never loops. The nested structure of an HTML page, the categories in this site's Code Talk section, a tournament bracket — all trees, all following the same two rules.
The vocabulary around trees borrows directly from the metaphor: the top node is the root, a node with no children is a leaf, and a node's connections downward go to its children — a slightly odd mental image of a tree drawn upside down with its root at the top, but one that's stuck because it maps so cleanly onto the family-tree and org-chart pictures most people already carry around.
Recognizing "this is really a tree, not just any graph" is useful in practice because trees support faster, simpler algorithms than graphs in general — searching a well-organized tree can skip over huge portions of it at once, the same idea behind how a binary search cuts a sorted list in half repeatedly, precisely because a tree's no-loops rule guarantees there's only ever one path to follow, with no need to double back and check whether you've been somewhere before.
