Contact electrification is a process during which two materials acquire electric charges after being brought in contact with one another. The contact can be either simple touch of their surfaces or friction between them - in the latter case this phenomenon is called tribocharging. This phenomenon has been known for thousands of years; the ancient Greeks were familiar with the fact that they could make objects attracted to amber by rubbing them on it. It was also exploited by Alessandro Volta when he made in the 18th century his voltaic pile, the precursor to our batteries.
Nonetheless, this phenomenon is poorly understood. While it seems obvious that it arises from the exchange of charges between the materials in contact, little can be said about whether it is the positive or negative charges moving, let alone why an ion in an overall neutral material would have the tendency to leave its balanced environment, hop across an interface, and end up in an environment which is now electrostatically imbalanced.
Empirical observation over the last couple of centuries has led to the more-or-less agreed upon triboelectric series, a list of materials in order of decreasing amount of positive charge acquired upon contact (see also lecture notes on Charged Interfaces). More recently scientists have developed tools for the accurate measurement of the acquired charge by contact, such as the rolling sphere tool (ref: 11 in Controlling the Kinetics of Contact Electrification with Patterned Surfaces) which measures the charge accumulated on a magnetically controllable sphere rolling on a surface.
From such and similar observations, it has been more or less concluded that when it comes to contact electrification between two different metals, the charges accumulated on each side correlate with the work function of the electrons - i.e. the energy required to remove an electron from inside the metal to just outside of it. This, in turn, seems to indicate that in the case of metals it is the electrons that move .
The case of dielectrics seems to be a bit more complicated, as there is disagreement between experimenters regarding any correlation of the accumulated charges with quantities that one would think relevant, such as electronegativity or ionization energy. It is possible that such experiments are very sensitive to ambient conditions (ex. humidity, which would affect the conductivity of the air between the surfaces), surface roughness, and the exact manner by which two materials are brought in contact and then taken apart, making the results of these studies hard to systematize. One fact which seems to be generally accepted is a correlation between accumulated charge and acidity or basicity .
The fundamental understanding of contact electrification and subsequent understanding of ways to control it has a lot of potential applications. Learning how to prevent contact electrification may provide solutions to associated problems, such as explosions due to sparking (for example in silos containing powders) or damage in electronic circuits. Learning how to engineer a system where known amounts of charge can be exchanged between particles may be a new tool for directed self-assembly. Moreover, this knowledge may lead to the development of novel materials that can maintain a permanent charge, by analogy to permanent magnets, which could be used in their stead as an alternative with longer-range interaction strength.
Keyword in references:
 Charged Interfaces, Ian Morrison, lecture notes for Introduction to Soft Matter
 Triboelectric Generation: Getting Charged, available at www.esdjournal.com/techpapr/ryne/ryntribo.doc
 Electrostatic Charging Due to Separation of Ions at Interfaces: Contact Electrification of Ionic Electrets, Logan S. McCarty and George M. Whitesides, Angewandte Chemie, Angew. Chem. Int. Ed. 2008, 47, 2188 – 2207