Total-Energy pseudopotential calculations are used to study both the onset and development of plasticity in nanoindentation experiments and the contrast mechanism in non-contact AFM images on Si (111) surfaces. As regards nanoindentation, plastic flow of atoms towards interstitial positions and extrusion of material towards the tip walls, stabilized by the adhesive interactions with the tip, are the dominant mechanisms. These plastic deformations are triggered by the delocalization of the charge induced by the stress in the elastically compressed structure. Atomic resolution contrast in AFM is shown to be clearly enhanced by the partial covalent chemical interaction between the dangling bonds of the adatoms in the surface and the apex atom in the tip. The contrast mechanism can be understood in terms of the coupling between the tip and the charge transfer modes among the different dangling bonds in the surface.