Hydraulic fracturing is a fundamental condition for economic production of hydrocarbons from unconventional reservoirs. Hydrocarbon production is proportional to the propped surface area that is in contact with the reservoir and remains connected to the wellbore. Yet, the propped surface area controlling production appears to be considerably smaller than the surface area created during pumping. Somehow hydraulic fractures are disconnected, truncated, and reduced during production. One important mechanism causing this segmentation is the shear displacement of weak interfaces between rock layers. Shear stresses are generated in response to abrupt changes in material properties and changes in bed orientation, in relation to the orientation of the existing principal stresses. If the layered rocks are strongly laterally heterogeneous, they provide a high potential for shear failures and fracture segmentation along the interfaces between layers. The induced shear stress and shear slip also depend on the current geologic structure and following in situ stress loading, the stress alteration and fluid leakoff during hydraulic fracturing, and the existence of wells. We conducted numerical simulations using the finite-element method on layered and discontinuous rocks, and specifically in organic-rich mudstones and carbonate sequences. Our work was part of a field study. Three different layered rock models were simulated and compared: laterally homogeneous, laterally heterogeneous, and strongly laterally heterogeneous. For the latter, the heterogeneity was introduced by randomly varying the elastic rock properties of each layer. Our results indicate that localized shear stresses develop along interfaces between materials with contrasting properties and along the wellbore walls. This includes the generation of localized shear in planes that were principal in the homogeneous model. It was also seen that rock shear and slip, along interfaces between layers, may occur when the planes of weakness are pressurized (e.g., during hydraulic fracturing).