Mechanisms Controlling Friction and Adhesion at the Atomic Length-Scale