Much like its late-harvest cousins, the circumstances have to be just right for icewine production. It is always risky to let the grapes hang after typical harvest time. While sugars do continue to concentrate in the berries the longer they hang there, other problems can arise like rots (which, unlike Sauternes or some other "noble rot" wines, we do not want with icewine,) or even destruction by insects or birds (they like sugar just as much as we do.) However, if it is a particularly dry year in a cooler dry climate (no rot risk,) and a hard early freeze is expected, this can mean gold for icewine producers.
What happens is that water in the berries freezes, so when pressed, all that comes out are the sugars and flavor components, leaving behind most of the water. This makes for a VERY sugary concoction (though as you can imagine, not a very high juice yield- which is why many icewines are pricier.) Once fermented, this wine still retains a high sugar concentration, making it a great dessert-sipper.
For producers, this is a laborious, risky practice. Sometimes they stumble into it by accident when hit with an unexpected freeze, but in cold-weather climates, it is a goal for many winemakers. It usually involves staying up all night, monitoring the temperature in the vineyard and then running out to harvest and press immediately, often outside in the cold so that the berries don't thaw. This means you have to have a LOT of people out in below-freezing temps in the wee hours of the morning, picking berries like mad, knowing you'll yield very little juice. CRAZY TIMES at the winery! Cold, cold, crazy times.
So, next time you're in the store and you're looking for an icewine, don't balk at the price- they're labor-intensive and not a guaranteed success for their producers. But when they work, and you've got a sweet tooth, they really hit the spot!