Electricity is caused by electrons, the tiny particles that "orbit" around the edges of atoms, from which everything is made. Each electron has a small negative charge. An atom normally has an equal number of electrons and protons (positively charged particles in its nucleus or center), so atoms have no overall electrical charge. A piece of rubber is made from large collections of atoms called molecules. Since the atoms have no electrical charge, the molecules have no charge either—and nor does the rubber.
Suppose you rub a balloon on your jumper over and over again. As you move the balloon back and forward, you give it energy. The energy from your hand makes the balloon move. As it rubs against the wool in your jumper, some of the electrons in the rubber molecules are knocked free and gather on your body. This leaves the balloon with slightly too few electrons. Since electrons are negatively charged, having too few electrons makes the balloon slightly positively charged. Your jumper meanwhile gains these extra electrons and becomes negatively charged. Your jumper is negatively charged, and the balloon is positively charged. Opposite charges attract, so your jumper sticks to the balloon.
That's a very brief introduction to static electricity. You'll find much more about it (and why it's caused by something called triboelectricity) in our main article on static electricity.//reference URL//