Microscopic aspects of adhesion and lubrication