In a perfect world, all heatsinks would be milled to be perfectly flat. In real life, most heatsinks have minor imperfections that can make a major difference in heat transfer. The problem here is that the heat is not being transferred to the heatsink as efficiently as possible, since it's stifled by having to be transferred through the air between the two. One possible solution to this problem is lapping. The problem with this is that, if it isn't done well, it may not end up being any better of a contact.
Most people simply end up using thermal paste or thermal tape to ensure good transference.
Thermal paste, also known as thermal grease, is usually made up of zinc oxide and a silicon grease. It's not as good as a perfectly tight fit, but it's much better than an imperfect fit stifled with downright tiny pockets of air. Of course, many heatsinks, however, don't ship with thermal grease. The quality of the stuff they do ship with varies widely. The problem is that it usually doesn't fill the gaps as well, being it has to be a more solid form to travel well.