Granular materials are a part of a broad class of amorphous materials that display yield stress behavior. When the applied shear stress is below the yield stress, grains move temporarily, but only until finding a mechanically stable (MS) configuration that is able to resist the applied shear stress. Above the yield stress, the material is no longer able to find MS configurations. However, the geometrical reasons why MS states vanish at the yield stress is not well understood. In this talk, I will show evidence from molecular dynamics simulations that yielding in granular materials is akin to a second-order critical point, where the mechanical behavior is dominated by a correlation length that diverges at the yield stress. MS states exist above the yield stress for finite systems, but they vanish as the system size becomes large according to a critical scaling function. The packing fraction and coordination number for MS states are independent of the applied shear stress, implying that the critical behavior we observe is distinct from the well known jamming scenario. However, MS states at nonzero shear stress possess anisotropic force and contact networks, suggesting that the yield stress is set by the maximum anisotropy that can be realized in the large-system limit.