How does sliding your feet on carpet give you a static charge?
Sliding friction tends to wipe electric charge from one surface to another. Which surface acquires positive charge and which negative charge depends on the chemical properties of those surfaces. You end up with one charge and the carpet with the opposite charge.