How they work
A hash function maps a key to a bucket index. Good hashing distributes keys uniformly so most buckets hold ~one item, giving O(1) average operations. JS Map/Object, Python dict/set, and Java HashMap are all hash tables.
Collisions & load factor
Two keys can hash to the same bucket. Chaining stores a list per bucket; open addressing probes for the next free slot. As the load factor (items / buckets) rises, collisions increase, so tables resize (rehash) to keep operations fast — which is why worst-case is O(n).