Not registered yet?
Register now! It is easy and done in 1 minute and gives you access to special discounts and much more!
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?
Two small facts to add to Lubos's answer:
The effect in which two objects get charged by rubbing and remain charged is called the triboelectric effect,
where the root "tribo" means friction in Greek (The Greek word $\tau\rho\iota\beta\omega$ 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:
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 $SiO_2$ - 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.
Tribo is from Latin "tribulare", Both Volta and Galvani Potentials I did not mention. That english Wiki on tribolelectricity is bad, the german Version de.wikipedia.org/wiki/Reibungselektrizit%C3%A4t is much better. And Electronegativity: please Lubos! It seems You like that invention of Pauling, but please use it only where it is aimed for! Electronegativity controls polarisation of bonds between atoms within molecules, nothing else! Do You rub cesium rods with a fluorine rag?
Dear Georg, the practical observation that rags are usually not made out of fluorine, even if true, doesn't invalidate the statement that cesium rods would gain electrons from fluorine rags if you tried, does it? The default form of the Latin verb you spelled "tribulare" is "tribulo", not "tribulare", it means squeeze, press, or extract, and has nothing to do with the explanation on the German Wikipedia. That German article uses another verb "tribere", which is indeed "rub", but it was manifestly taken from the Greek root "tribo", see wordinfo.info/unit/2178
In the German version You find the relation to electron affinity, which is maybe what You had in mind, when relating to electronegativity? In fact, the few organic molecules for which electron affinities are known , give a guide to components in a solid to be high or low in "Berührungsspannung".