Intensive experiments have revealed that the superconductivity of the hole-doped cuprates can be strongly suppressed at the so-called magic doping fractions. Despite great research efforts, the origin of the 'magic doping' remains mysterious. Recently, we have developed a real-space theory of high-temperature superconductivity which reveals the intrinsic relationship between the localized Cooper pair and the localized hole pair (arXiv:1007.3536). Here we report that the theory can naturally explain the emergence of non-superconducting checkerboard phases and the magic doping problem in hole-doped cuprate superconductors. It clearly shows that there exist only seven 'magic numbers' in the cuprate family at x =1/18, 1/16, 2/25, 1/9, 1/8, 2/9 and 1/4 with 6a × 6a, 4a × 4a, 5a × 5a, 3a × 3a, 4a × 4a, 3a × 3a, and 2a × 2a checkerboard patterns, respectively. Moreover, our framework leads directly to a satisfactory explanation of the most recent discovery [M. J. Lawler, et al. Nature 466, 347 (2010)] of the symmetries broken within each copper-oxide unit in hole-doped cuprate superconductors. These findings may shed new light on the mechanism of superconductivity.