In: Physics
It is always told as a fact without explaining the reason. Why do two objects get charged by rubbing? Why one object get negative charge and other get positive charge?
The effect in which two objects get charged by rubbing and remain charged is called the triboelectric effect,
http://en.wikipedia.org/wiki/Triboelectric_effect
where the root "tribo" means friction in Greek (The Greek word ????? means 'to rub'). Friction is actually unnecessary: contact is enough in principle.
This effect shouldn't be confused with the (Volta or Galvani) "contact potential" between metals which only exists as long as the two metals remain in contact, and especially not with "contact electrification" which was a name of a scientifically incorrect theory of electricity at the end of the 18th century that attempted to overgeneralize the interpretation of the triboelectric effect. "Electrophorus" was a gadget, first produced by Volta, that used the triboelectric effect.
The cause of the triboelectric effect is adhesion - the atoms on the surface literally form chemical bonds. Materials such as fur are ready to lose electrons and become positively charged while the materials such as ebonite or glass gain electrons and become negatively neutral. To get some idea about which atoms are likely to lose or gain electrons, it's useful to know their electronegativity:
http://en.wikipedia.org/wiki/Electronegativity#Electronegativities_of_the_elements
The redder atom, the higher electronegativity, and the more likely it is for the atom to gain electrons and become negatively charged. That's especially true for light halogens (fluorine, chlorine) and oxygen. That's partly why glass - with lots of - likes to get negatively charged in the triboelectric effect. Even sulfur (40% of ebonite) has a higher electronegativity than e.g. carbon and hydrogen that are abundant in the fur which is why fur loses electrons and becomes positively charged.
Of course, the actual arrangement of the atoms in the molecules matters, too. So this overview of the periodic table was just an analogy, not a reliable way to find out the results of the triboelectric effect.