Merge Algorithm
Recall from Chapter 1, “Learning the Basics,” that HKCR was a link to the key HKLM\SOFTWARE\Classes before Microsoft Windows 2000, but it is more complicated now. Windows merges HKLM\SOFTWARE\Classes and HKCU\Software\Classes. The data in HKLM is default file associations and class registrations, whereas the data in HKCU is per-user file associations and class registrations. HKCU\Software\Classes is really a link to HKU\SID_Classes, which Windows loads when it loads the profile hive in HKU\ SID. If the same value appears in both branches, the value in HKCU\Software\Classes has higher precedence and wins over the value in HKLM\SOFTWARE\Classes.
Chapter 1 described the benefits of this merge algorithm, but in short, it enables users to install applications and use file associations that don't affect other users. Thus, two users who share a computer can use two different programs to edit the same types of files.
When you create a new key in the root of HKCR, Windows actually creates it in HKLM\SOFTWARE\Classes. Windows doesn't provide a user interface other than Registry Editor to add class registrations to HKCU\Software\Classes because the intention is to allow programs to register per-user program classes. When you edit an existing program class, however, the change is reflected in HKLM or HKCU, depending on where the program class already exists. If the program class exists in both places, Windows updates only the version in HKCU.