Earthquakes have long been recognized as being the result of stick-slip frictional instabilities. Over the past few decades, laboratory studies of rock friction have elucidated many aspects of tectonic fault zone processes and earthquake phenomena. Typically, the static friction of rocks grows logarithmically with time when they are held in stationary contact, but the mechanism responsible for this strengthening is not understood. This time-dependent increase of frictional strength, or frictional ageing, is one manifestation of the 'evolution effect' in rate and state friction theory. A prevailing view is that the time dependence of rock friction results from increases in contact area caused by creep of contacting asperities. Here we present the results of atomic force microscopy experiments that instead show that frictional ageing arises from the formation of interfacial chemical bonds, and the large magnitude of ageing at the nanometre scale is quantitatively consistent with what is required to explain observations in macroscopic rock friction experiments. The relative magnitude of the evolution effect compared with that of the 'direct effect'--the dependence of friction on instantaneous changes in slip velocity--determine whether unstable slip, leading to earthquakes, is possible. Understanding the mechanism underlying the evolution effect would enable us to formulate physically based frictional constitutive laws, rather than the current empirically based 'laws', allowing more confident extrapolation to natural faults.