Static electricity occurs when the body builds up an imbalance of electrical charges. When an object moves against an insulating surface like carpet, weakly bound electrons can move from one surface to another, creating a charge. When that charged object touches a conductor, it releases the electrons, creating a spark.
Hair standing on end is a demonstration of static electricity. When a person rubs a balloon against her hair, it transfers electrons from the hair follicles to the balloon. This creates an electrical imbalance, and each hair strand becomes positively charged. Since like charges repel, each strand of hair is pushed away from the strands around it, causing the hair to stand on end.