That's a heat sink and it helps to transfer the heat generated by an electronic (or a mechanical device) to a fluid medium. In the case of a cpu its the air that moves with the help of the fan. The slots that you noticed are actually fins. Fins are extended surface which enhance heat transfer by conduction and convection. This increase in heat transfer is primarily due to lowering of thermal resistance. Thermal resistance of a fin can be lowered by increasing the thermal conductivity and the overall area of convection. An increase in thermal conductivity increases heat transfer by conduction. An increase in overall area of convection increases convective.