The anchoring direction taken by a nematic liquid crystal at the surface of a substrate can be varied, leading to anchoring transitions. Several examples of such transitions have been observed at the surface of mica when the system is put in presence of water and alcohol vapour. A macroscopic model, characterizing the liquid crystal-mica interface by its energy as a function of the liquid-crystal orientation, can reproduce all the observed transitions but does not give any information about the microscopic mechanisms leading to these transitions. More insight on these mechanisms is obtained from studies of the orientational distribution of the liquid crystal molecules in contact with the substrate performed using optical secondharmonic generation. These studies show that the bulk reorientation characterizing the first-order anchoring transitions observed on mica is driven by a first-order orientational transition in the surface liquid crystalline layer. More generally, these studies provide the boundary conditions on the liquid crystalline orientational order necessary for a microscopic description of the order close to a substrate surface.