Silica gel packets can act as a desiccant to absorb excess moisture on the inside of the headlight assembly. Not only does it absorb moisture, it holds onto it as well. Silica gel packets are known to hold roughly 40% of their weight by absorbing excess water.
Silica gel packets can only be used as a temporary fix for excess moisture. If the problem keeps reoccurring, you will have to use a hair dryer, or if there is too much moisture, the headlight is best unassembled and cleaned of excess water.