Arrays and linked lists put things in a line. A lot of the world isn't a line — it branches. And branching turns out to be the key to searching huge amounts of data in a handful of steps. Those are the two big reasons trees exist.
Whenever things contain other things, you have a tree:
(2 + 3) × 4 becomes the tree on the right, and evaluating it is a tree walk.Only trees with at most two children per node are binary trees, and many of these hierarchies have more. But binary trees are the ones interviews and data structure libraries are built on, and everything you learn here carries over.
Suppose a tree keeps one simple rule at every node: everything in the left subtree is smaller, everything in the right subtree is bigger. That's a binary search tree (BST). To find a value, compare it with the root — and you know which side it must be on. The other side, with possibly half the data, is never looked at.
Search for a value that isn't there: you still only walk one path.
The cost is the number of levels walked: the tree's height. A balanced tree doubles its capacity with every level, so its height is about log₂ n: 20 levels hold a million values, 30 hold a billion.
A tree's speed depends entirely on its shape. That's why real libraries use self-balancing trees (red-black trees in Java's TreeMap and C++'s std::map, B-trees in databases) that rotate nodes to keep the height near log n after every insert and delete.
A balanced BST is the all-rounder: nearly as fast as a hash table, and it also answers ordered questions — the smallest value, the next bigger key, every value between 10 and 20 — which hashing can't. Trees also power heaps (priority queues), tries (autocomplete) and segment trees (range queries), all of which you'll meet later.