When two bodies come in close contact with each other, the irregularities on the surface touch each other and exert enormous pressure as the area of contact between surfaces is very small. The atoms of the objects come very close and start experiencing electrostatic force and in a way get cold welded to each other. When the objects try to move relative to each other, work has to be done to break these electrostatic cold welds. This is the origin of frictional force. It's worth mentioning that if we bring two perfectly smooth bodies in contact, they will exhibit very high coefficients of friction when moving relative to each other.
Tension in ropes is another example of electrostatic force.