The solution uses a hash map to remember which nodes you've already copied.
As you visit each original node during DFS, check your map. If you've already created a copy of this node, return that copy. If not, create a new node, store it in the map, then recursively copy all its neighbors.
This ensures each original node maps to exactly one copied node. When multiple nodes reference the same neighbor, they all get the same copied neighbor from your map.
The map structure: original_node → copied_node. Think of it as a translation dictionary.