Atypon Systems interview question

How does a hash function works? What happens if 2 records have the same hash?