Electronic structure of interfaces, their stability and the mechanism of decohesion in tension as well as of ideal shear have been studied by means of ab initio density-functional theory for heterostructures consisting of a few nanometer thick fcc͑NaCl͒-TiN slabs with one monolayer of pseudomorphic SiN interface. It is found that the SiN interface sandwiched between fcc͑001͒-TiN slabs is unstable in its symmetric fcc structure, but it stabilizes by distortion of the Si-N bonds, which lowers the symmetry. Significant strengthening of the SiN interface occurs due to partial transfer of valence charge to the Si containing interface which induces damped valence charge-density oscillations propagating into the TiN bulk. As a consequence of these oscillations, decohesion, and ideal shear does not occur within the SiN interface, but in the TiN slabs between the Ti-N planes parallel to that interface. We provide a detailed study of this mechanism of decohesion and ideal shear on the atomic scale. The results are discussed in the context of the experimentally found hardness enhancement in heterostructures and superhard nanocomposites.