A mechanism for the effect of grain size on yield strength