In normal condition the number of protons and electrons in any atom is equal. But every atom has got an affinity for getting excess electrons. Due to it when two bodies are brought in contact with each other, the body which has a greater affinity for electron collect electrons from other body and gets charged negatively this is called as electrification by friction.
Example = When a glass rod is rubbed with silk, Silk gets negatively charged and glass rod gets positively charged. As shown in the figure below.