Friction is an external force opposing relative motion between two contact surfaces. Friction acts on the surface of contact of both the bodies. When one object moves compared to another, it is known as relative motion.
Cause of friction
The surface irregularities of the two objects in contact cause friction
When zoomed into a microscopic stage, all surfaces contain hills & valleys that interlock when moving or rubbing on top of each other. Such surface unevenness is termed surface irregularities (roughness). Rough surfaces are more irregular, whereas smoother surfaces are less irregular.
Adhesive forces between contact surfaces
When two surfaces are in contact, they begin to form bonds and then they begin to stick together. It is called Adhesion phenomenon. When we try to move objects on top of another, we ultimately weaken the bonds or conquer the adhesive forces.
When surfaces are soft, or can easily change shape, they become deformed when they come into contact with another material. Ex: carpets, it looks like a valley produced by the deformation of the shape when a large object is placed on them. The consequence of the sinking surfaces in one another is known as the Plowing effect.