Memory and Friction: From the Nanoscale to the Macroscale