There are 3 ways to dissipate heat: radiation, convection, and conduction. Radiation and convection are neglectable in such small package. Conduction is the only available heat transfer mechanism. The magnet is a big chunk of metal in this assembly, which helps transfer heat to the metal case.