The trick
A hash map gives average O(1) insert and lookup. That single fact collapses a huge class of "find a pair / detect a duplicate / count occurrences" problems from O(n²) to O(n).
Example: two-sum
Instead of checking every pair (O(n²)), scan once, and for each number ask the map "have I seen target − x already?" One pass, O(n).
The catch
O(1) is average, not worst case. Collisions and resizing exist, and hashing a bad key (or relying on iteration order) bites people. But for interview-scale problems, "reach for a hash map" is the highest-leverage instinct you can build.