Like jayt said, it happens when the glass is a different temperature on both sides. It's the same thing that happens to your windscreen on a cold morning..
Make sure you do it on a dry day too, and leave the covers of for a bit to let the fresh, dry air into the headlights before slapping them in.