Sweating is simply a phenomenon that happens between moisture and a humectant. The humectant is typically glycerin. Glycerin is a natural byproduct of saponification and it is sometimes added as a moisturizing agent. Glycerin in soap (and shampoo bars) attracts moisture from the air which form on the surface of the soaps - this is so-called soap 'sweating'. The moisture is not coming from inside the soap or shampoo. This is moisture from the air being attracted by the glycerin in the soap. The more humid the environment, the more likely the humectant will attract moisture on to the surface. Sweating is not an alarming phenomenon. There's only one way to prevent sweating. Lower the humidity by using an air conditioner or dehumidifier. If it's really humid, just let the bar sweat.
Why does my soap sweat or weep?
Is this article helpful?