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), versus a list of full names where you have to check each name to find those starting with a prefix (hash map).
Trie:
root
├─ a
│ ├─ p
│ │ ├─ p
│ │ │ └─ l
│ │ │ └─ e (end)
└─ b
└─ a
└─ t (end)
Hash Map:
{
"apple": true,
"bat": true
}