Graphite and other lamellar materials are used as dry lubricants for macroscale metallic sliding components and high-pressure contacts. It has been shown experimentally that monolayer graphene exhibits higher friction than multilayer graphene and graphite, and that this friction increases with continued sliding, but the mechanism behind this remains subject to debate. It has long been conjectured that the true contact area between two rough bodies controls interfacial friction1. The true contact area, defined for example by the number of atoms within the range of interatomic forces, is difficult to visualize directly but characterizes the quantity of contact. However, there is emerging evidence that, for a given pair of materials, the quality of the contact can change, and that this can also strongly affect interfacial friction2, 3, 4, 5, 6, 7. Recently, it has been found that the frictional behaviour of two-dimensional materials exhibits traits8, 9, 10, 11, 12, 13 unlike those of conventional bulk materials. This includes the abovementioned finding that for few-layer two-dimensional materials the static friction force gradually strengthens for a few initial atomic periods before reaching a constant value. Such transient behaviour, and the associated enhancement of steady-state friction, diminishes as the number of two-dimensional layers increases, and was observed only when the two-dimensional material was loosely adhering to a substrate8. This layer-dependent transient phenomenon has not been captured by any simulations14, 15. Here, using atomistic simulations, we reproduce the experimental observations of layer-dependent friction and transient frictional strengthening on graphene. Atomic force analysis reveals that the evolution of static friction is a manifestation of the natural tendency for thinner and less-constrained graphene to re-adjust its configuration as a direct consequence of its greater flexibility. That is, the tip atoms become more strongly pinned, and show greater synchrony in their stick–slip behaviour. While the quantity of atomic-scale contacts (true contact area) evolves, the quality (in this case, the local pinning state of individual atoms and the overall commensurability) also evolves in frictional sliding on graphene. Moreover, the effects can be tuned by pre-wrinkling. The evolving contact quality is critical for explaining the time-dependent friction of configurationally flexible interfaces