Bedding planes and property contrast between layers plays an important role in preventing hydraulic fracture height extension in shale reservoirs. However, the intrinsic causes of fracture containment have not been elucidated, and few studies have considered the effects of mixed factors on fracture height extension. Based on the continuum-discontinuum element method, a 3D hydraulic-mechanical coupling model was established to explore the influence mechanism of bedding planes, stress and modulus difference between layers, and mixing factors on fracture height extension in a transversely isotropic shale reservoir. Shear failure usually occurs preferentially when the fracture approaches the bedding plane, and the essential reason for fracture containment is that the shear slip on the bedding plane blunts the fracture tip. The stronger stress barrier formed by the higher minimum principal stress in adjacent formation effectively enables the fracture to terminate at the interlayer interface. The lower modulus in adjacent formation is more prone to rock initiation, but the larger elastic deformation absorbs the fracture tip stress and impedes height propagation. The comprehensive effect of bedding planes and property contrast between layers on fracture propagation is more complex than that of a single factor. When different factors have positive effects on fracture containment, the fracture is easier to terminate at the bedding plane. Otherwise, the dominant factor determines whether the fracture can be captured. No matter what the conditions, the pressure relief in the bedding plane can slow down the propagation rate. The findings can offer theoretical support for predicting fracture height during field fracturing in shale reservoirs.