When certain insulating materials are rubbed against each other, they become electrically charged. The negatively charged electrons are rubbed off one material and on to the other. The material that gains electrons becomes negatively charged. The material that loses electrons is left with an equal positive charge, so it becomes positively charged. Only electrons move. The positive charges in the atoms stay where they are. For example, rubbing a polythene rod with a cloth can move electrons from the cloth to the rod, so the rod becomes negative and the cloth becomes positive.
Charged objects exert forces on each other even when they are not touching. Two objects with the same type of charge repel. Two objects with different types of charge attract. Because these forces act without contact, they are examples of a non-contact force. Evidence for this is easy to see. Two charged rods hung from threads swing away from each other if both are negative, and swing towards each other if one is positive and one is negative. A charged rod will also attract small scraps of paper.
Charge can build up on an insulator because the electrons cannot easily flow away. If the charge on an object becomes large enough, electrons can jump across the gap to a nearby object, or to the ground. This is a spark. Lightning is a very large spark.