
When the comb runs through dry hair, it gets charged by friction. The molecules in the paper get polarized by the charged comb, resulting in a net force of attraction. If the hair is wet, or if it is a rainy day, the friction between the hair and comb reduces. The comb does not get charged and hence it will not attract the bits of paper.