Static electricity results from an imbalance between positive and negative charges in an object, according to the Library of Congress. It affects daily life in numerous ways, such as causing hair to rise when a person removes his hat as the electrons get transferred from the hat to the hair.
Physical objects are composed of atoms, states the Library of Congress. An atom contains protons, electrons and neutrons. Protons have a positive charge, whereas electrons have a negative charge. Neutrons are neutrally charged particles. Static electricity occurs when negative and positive charges in an object are not balanced, causing the charges to accumulate on the object's surface until they get released or discharged.
When some materials rub against each other, electrons tend to get transferred, the Library of Congress explains. For instance, rubbing a shoe on a carpet enables the body to collect extra electrons, which stick to the body until they are released. When a person subsequently touches a dog, he is likely to experience a shock as the surplus electrons get released and transferred to the animal. Another example is when a person rubs a balloon against his clothes and the balloon sticks to the wall. In this case, he is adding a surplus of electrons to the balloon's surface. The balloon sticks upon contact with the wall, which is more positively charged than the balloon. This occurs because opposite charges attract.