A hash map turns a key into a number with a hash function, and that number says exactly which bucket the value lives in. No scanning, no searching: compute, jump, done.
Two keys can land in the same bucket (a collision), so buckets hold small lists. As long as collisions stay rare, lookups stay effectively O(1), which is why hash maps sit under almost every language's dictionary.