Mental Model
A trie stores words by their letters in a tree, making prefix search fast. A hash map stores whole words as keys, so prefix search needs extra work.
Analogy: Imagine a phone book organized by first letter, then second letter, and so on (trie). Searching by prefix is quick because you follow the letters. A hash map is like a pile of cards with full names; to find all starting with 'Jo', you must check each card.
Trie:
root
├─ j
│ ├─ o
│ │ ├─ h
│ │ │ └─ n (end)
│ │ └─ e (end)
└─ m
└─ a
└─ r
└─ y (end)
Hash Map:
{
"john": true,
"joe": true,
"mary": true
}