Atoms hold protons, which carry positive charge, and electrons, which carry negative charge. Most objects contain equal amounts of positive and negative charge, so they are neutral. Static electricity is the buildup of electrical charge in an object. The charge itself is not created. It moves. Electrons are the mobile part; protons stay fixed in the nucleus. When electrons shift from one material to another, the material that gains them becomes negatively charged, and the one that loses them becomes positively charged. The charge sits on the surface of an object, not in its interior. In insulators, the transferred electrons stay on the surface because they cannot move freely through the material. The usual cause is friction between insulators. Rubbing two different insulators together transfers electrons. This process is known as the triboelectric effect. The triboelectric effect is a form of contact electrification, where materials become charged after being brought into contact and then separated. It occurs for all solid materials. The effect is strongest with insulators, which hold the transferred charge in place. The rubbing creates many surface contacts, allowing electrons to transfer. The direction of transfer depends on the materials' properties. Some materials give up electrons easily; others hold them tightly. The triboelectric series ranks materials by their tendency to gain or lose electrons. Materials near the top of the series tend to give up electrons, while those near the bottom tend to gain them. When two materials are rubbed, the one that holds electrons more tightly will pull them from the other. This transfer happens because the atoms on one surface hold their outer electrons more loosely than the atoms on the other surface. For example, when you rub a balloon on your hair, the balloon gains electrons and becomes negatively charged. Your hair loses electrons and becomes positively charged. Because the balloon and hair now have opposite charges, they attract each other. That is why your hair stands up when you pull the balloon away. Each hair strand also repels its neighbors because they share the same charge, which makes the hair spread out. The effect is more noticeable in dry air. Water molecules in humid air provide a path for electrons to move, so the charge dissipates. In dry air, the charge lingers because there is little water vapor to carry it away. Indoor heating in winter dries the air, so static charges are more likely to build up. The charge is called static because it stays in place until a conductor comes near.

A charged balloon can stick to a neutral wall. The balloon's negative charge repels electrons in the wall's molecules. The electrons move away, leaving the near side of the wall positively charged. That induced positive charge is closer to the balloon than the negative charge, so the attraction wins. This is called charge polarization. It is the same effect that makes socks from a dryer cling together. The socks carry opposite charges after tumbling, but they can also stick to neutral fabrics through polarization. The net force is always attractive because the opposite charge is always closer. The wall does not need to be charged. It only needs to be polarizable. Most materials, including wood, drywall, and painted surfaces, can respond this way. The strength of the attraction depends on how easily the material's electrons can shift. The polarization lasts only as long as the balloon is near the wall. The wall remains neutral overall, but its surface is polarized. When the balloon is removed, the electrons return to their original positions, and the wall becomes neutral again.

The charge on a balloon can last for a measurable time because a rubber balloon is an insulator and holds charge well. A metal object would not, because metals conduct electrons easily. That is why static experiments use insulators like balloons, plastic combs, and wool. The same physics explains why you get a shock from a doorknob after walking on a carpet in low humidity. When you shuffle your feet on a carpet, your skin builds up a static charge from the friction. The charge sits still until you touch a conductor, and then it moves as a spark. The spark is the visible release of the stored charge as electrons jump across the gap. If you touch a charged balloon, the charge can flow to your hand, giving you a small shock. The shock is the same phenomenon as the spark from a doorknob, just on a smaller scale.