Here's the breakdown:
* Friction: When you rub two materials together, the friction causes electrons to be dislodged from their atoms.
* Electrostatic attraction: Materials have different tendencies to hold onto their electrons (this is called electronegativity). The material with a stronger attraction (higher electronegativity) will pull electrons away from the material with a weaker attraction (lower electronegativity).
* Charge transfer: This movement of electrons creates an imbalance of charge. The material that loses electrons becomes positively charged, while the material that gains electrons becomes negatively charged.
Let me know if you'd like more details on any of these points!