The friction-driven static electrification is familiar and fundamental in daily life, industry, and technology, but its origin has long been unknown. It is very mysterious, in spite of the state-of-the-art quantum mechanics and condensed matter physics, why we do not know which material will be charged positively or negatively when two materials are rubbed. We jumped into this problem after we realized an abrupt temperature drop at the interface of two materials could cause significant thermoelectricity. Recently we have arrived at a quantitative explanation about the origin of triboelectricity by solving heat transfer equations and performing electronic structure calculations for various polymers, semiconductors, and metals. Here I will introduce how we formulate a rigorous theory of triboelectricity based on thermoelectric physics between two rubbing materials, which leads us to profound understandings and new discoveries on the fundamental phenomenon.