Describe the internal mechanics of a hash map and how collision resolution impacts lookup performance in the worst-case scenario.