Static electricity is an electric charge built up in one place. If you rub only one end of a plastic comb, then only that end becomes charged. The electric charges stay in one place. An object can become charged in several different ways. When electrons are transferred between two objects that are rubbed together, the objects become charged due to friction.
Conduction is another way that objects can become charged.
It is the direct contact between two objects. An object can also be charged by an already-charged object without there being contact between them. This object is said to be charged by induction. Normally a body is neutral since the number of electrons is almost equivalent to the number of protons. If a person rubs their shoes across a carpet in dry weather, the body builds up negative charges that are released from the carpet.