High resolution Atomic Force Microscopy (AFM) and Scanning Tunnelling Microscopy (STM) imaging with functionalized tips is well established, but a detailed understanding of the imaging mechanism is still missing. We present a numerical STM/AFM model, which takes into account the relaxation of the probe due to the tip-sample interaction. We demonstrate that the model is able to reproduce very well not only the experimental intra- and intermolecular contrasts, but also their evolution upon tip approach. At close distances, the simulations unveil a significant probe particle relaxation towards local minima of the interaction potential. This effect is responsible for the sharp sub-molecular resolution observed in AFM/STM experiments. In addition, we demonstrate that sharp apparent intermolecular bonds should not be interpreted as true hydrogen bonds, in the sense of representing areas of increased electron density. Instead they represent the ridge between two minima of the potential energy landscape due to neighbouring atoms.