What is the cause of friction

What is the cause of friction, and in what direction does it act with respect to the motion of a sliding object