To help prevent this, after plugging the two dry cords together, wrap the conjoined plugs completely with electrical tape, overlapping the tape to provide a total seal.
Then take a sandwich-size baggie and wrap it around the taped-up connection. Then wrap it all again completely with electrical tape. These three steps should completely seal the connection and prevent water or condensation from getting between the plugs.
At our Wild Birds Unlimited shop, we have an extension cord that instantly seals the connection without the tape and baggie routine; you just plug it in and screw it tight, which completely locks and seals the connection. The birdbath must be compatible to the extension cord; all our current WBU heated birdbaths are compatible with this type extension cord (older models may not be compatible).
By taking a fairly easy step to seal the connections, you will be able to enjoy years of realiable service from your heated birdbath. Ours has been in service for many years with no issues!