While the hydraulic fracturing technology, aka fracking (or fraccing, frac), has become highly developed and astonishingly successful, a consistent formulation of the associated fracture mechanics that would not conflict with some observations is still unavailable. It is attempted here. Classical fracture mechanics, as well as the current commercial softwares, predict vertical cracks to propagate without branching from the perforations of the horizontal well casing, which are typically spaced at 10 m or more. However, to explain the gas production rate at the wellhead, the crack spacing would have to be only about 0.1 m, which would increase the overall gas permeability of shale mass about 10,000$times$. This permeability increase has generally been attributed to a preexisting system of orthogonal natural cracks, whose spacing is about 0.1 m. But their average age is about 100 million years, and a recent analysis indicated that these cracks must have been completely closed by secondary creep of shale in less than a million years. Here it is considered that the tectonic events that produced the natural cracks in shale must have also created weak layers with nano- or micro-cracking damage. It is numerically demonstrated that a greatly enhanced permeability along the weak layers, with a greatly increased transverse Biot coefficient, must cause the fracking to engender lateral branching and the opening of hydraulic cracks along the weak layers, even if these cracks are initially almost closed. A finite element crack band model, based on recently developed anisotropic spherocylindrical microplane constitutive law, demonstrates these findings.