CPU shim
A CPU shim (also called CPU spacer) is a shim used between the CPU and the heat sink in a computer. Shims make it easier and less risky to mount a heatsink on the processor because it stabilizes the heatsink, preventing accidental damaging of the fragile CPU packaging. They help distribute weight evenly over the surface. CPU shims are usually made of thin and very flat aluminium or copper. Copper has good heat dissipation capacity but is electrically conductive.
A CPU shim (also called CPU spacer) is a shim used between the CPU and the heat sink in a computer. Shims make it easier and less risky to mount a heatsink on the processor because it stabilizes the heatsink, preventing accidental damaging of the fragile CPU packaging. They help distribute weight evenly over the surface.
CPU shims are usually made of thin and very flat aluminium or copper. Copper has good heat dissipation capacity but is electrically conductive. CPU shims should be non-conductive to prevent any accidental short circuiting. Aluminium shims are often anodized, which makes them non-conductive and improves their appearance (see case modding). It is also very important that the shim is the proper thickness. If it is too thick then the heatsink will not make contact with the CPU, resulting in poor cooling and possibly overheating.
Most shims are CNC manufactured, often using laser cutting. Cheaper ones may be pressed or stamped which could make them less accurate.

Usage
CPU shims are not common at all in OEM computers, but are used by some computer hardware enthusiasts who may use heavier heatsinks because they wish to have a cooler or less noisy system or perhaps to overclock the CPU for better performance. A heavy heatsink puts more pressure on the CPU and motherboard. Shims are very useful for people who often change CPU, heatsink or cooling solutions, or use a heatsink that is heavier than the CPU manufacturer's recommended weight.
CPU shims are nowadays largely obsolete because most modern processors designed for home users since the introduction of the Athlon 64 and Pentium 4 have an Integrated Heat Spreader (IHS) which prevents the CPU core from being accidentally broken.

See also
Computer fan
Computer cooling
Thermal grease