How does a concurrent hash map work under the hood, and how does it achieve thread safety without locking the entire structure?