Rehash

hash(key) % 16 and hash(key) % 32 are almost always different buckets. When the array grows, every entry has to be placed again in its new home.

old capacity 8:                  new capacity 16:
buckets[3] → "apple"    ──→      buckets[11] → "apple"
                                 (index changes because capacity changed)

Expensive. O(n). But you only pay it when the table crosses the load factor threshold, so averaged across all inserts, each insert is still O(1). See amortized.