VAIX interview question

What does a hash function do? How does a hashmap work?