  We study the stability and electronic structure of magic-angle twisted
bilayer graphene on the hexagonal boron nitride (TBG/BN). Full relaxation has
been performed for commensurate supercells of the heterostructures with
different twist angles ($\theta'$) and stackings between TBG and BN. We find
that the slightly misaligned configuration with $\theta' = 0.54^\circ$ and the
AA/AA stacking has the globally lowest total energy due to the constructive
interference of the moir\'{e} interlayer potentials and thus the greatly
enhanced relaxation in its $1 \times 1$ commensurate supercell. Gaps are opened
at the Fermi level ($E_F$) for small supercells with the stackings that enable
strong breaking of the $C_2$ symmetry in the atomic structure of TBG. For large
supercells with $\theta'$ close to those of the $1 \times 1$ supercells, the
broadened flat bands can still be resolved from the spectral functions. The
$\theta' = 0.54^\circ$ is also identified as a critical angle for the evolution
of the electronic structure with $\theta'$, at which the energy range of the
mini-bands around $E_F$ begins to become narrower with increasing $\theta'$ and
their gaps from the dispersive bands become wider. The discovered stablest
TBG/BN with a finite $\theta'$ of about $0.54^\circ$ and its gapped flat bands
agree with recent experimental observations.
