It depends on where the moisture is being detected, but if you had the phone in the bathroom when you were taking a shower, or went from a day of being in the hot humid outside, directly into a really cool inside (I'm talking about air conditioning turned up), the hot humid air in the phone gets chilled and the moisture condenses all over the inside of the phone. (The same with the bathroom - no phone is steam-resistant.)
I'd wait to plug the charger in until the phone had dried out. It needs a charge right now? No, it needs to be charged or turned off right now, so turn it off for a few hours. (And letting the battery get low enough that it needs to be charged right now is a good way to kill the battery - don't let it drop below 40% before charging it or turning it off if you want the battery to last.