The origins of residual stress gradients in nanocrystalline thin films, especially the role of grain size and texture gradients, are still not fully understood. In this work, the stress evolution in exemplary nanocrystalline TiN thin films with one and two fiber texture components as well as in homogeneous amorphous SiOx films is analyzed using wafer curvature as well as laboratory and synchrotron cross-sectional nanobeam X-ray diffraction techniques. The stress evolution across the film thickness is attributed to the evolutionary nature of microstructural development at the individual growth stages. While the effect of the smooth crystallographic texture changes during growth is only of minor importance, as this does not significantly affect the dominant stress formation mechanisms, the change in the grain size accompanied by a change of the volume fraction of grain boundaries plays a decisive role in the stress development across the film thickness. This is demonstrated on the monotextured thin films, where the residual stresses scale with the apparent grain size. These findings are validated also by the investigations of stress profiles in homogeneous amorphous SiOx films exhibiting no grain boundaries.