When two insulating materials are rubbed together (in this case a carpet and the balloon), the friction causes electrons on one material to be rubbed off and left stranded on the other.
Normally, objects are neutrally charged, meaning that the atoms have an equal number of protons and electrons. However, when we rub two insulating materials together, what we end up is one material is left too much electrons, and as result becomes negatively charged due to more electrons than protons.
Conversely, the other object is left with more protons than electron (loses it). Hence, it becomes positively charged.
Due to the nature of water molecules, they are polar, meaning that their molecules have a positive and negative charged ends, much like a magnet. They are very weakly attracted to charged objects.