A trie (prefix tree) stores strings by their shared prefixes — each edge is a character, each root-to-node path spells a prefix, and marked nodes end a word. That layout makes autocomplete trivial: walk to the prefix, then collect everything below it. Type below and watch the path light up.
ca in the box — the path root→c→a lights up and every completion (cat, car, card, care) appears instantly. That's all autocomplete is: one walk to the prefix node, then a DFS of its subtree. Notice car, card, care all share the c→a→r nodes — that prefix sharing is why a trie is compact and why lookup is O(length of the word), independent of how many words you've stored. Amber rings mark end-of-word nodes (so car is a word even though card continues past it). Insert and delete to watch the tree grow and prune.