Static electricity is the build up and transfer of charges between insulators. Charges are built up in objects when they lose or gain electrons. To acquire a charge in static electricity, two neutral objects are rubbed together and the friction between the objects allows electrons to be transferred from one object to another.
All matter in the universe is made of atoms. While atoms as a whole tend to be electrically neutral, they are composed of charged particles, namely positively charged protons and negatively charged electrons. Protons are tightly bound in the nucleus and electrons go around the nucleus in orbits. An atom can lose electrons and become positively charged because it has fewer negative charges, or it can gain electrons and become negatively charged. Whether an object is more likely to lose electrons or gain electrons depends on the materials that make up the object. When a material that prefers to lose electrons is rubbed together with a material that prefers to gain electrons, the friction between the objects causes the electrons from the first material to transfer into the second. The imbalance in charges within the material is called static electricity. For example, when a balloon, which is made of a material that has a tendency to gain electrons, is rubbed against human hair, which has a tendency to lose electrons, the friction between the balloon and the hair causes a transfer of electrons from the hair to the balloon. The now negatively charged balloon can then stick to a wall because of a force of attraction between its negative charge and the positive charges present in the wall.