  Defects in halide perovskites play an essential role in determining the
efficiency and stability of the resulting optoelectronic devices. Here, we
present a systematic study of intrinsic point defects in six primary metal
halide perovskites, MAPbI$_3$, MAPbBr$_3$, MAPbCl$_3$, FAPbI$_3$, CsPbI$_3$ and
MASnI$_3$, using density functional theory calculations with the SCAN+rVV10
functional. We analyse the impact of changing anions and cations on the defect
formation energies and the charge state transitions levels and identify the
physical origins underlying the observed trends. Dominant defects in the
lead-iodide compounds are the A$^+$ cation interstitials (A = Cs, MA, FA),
charge-compensated by I$^-$ interstitials or lead $({2-})$ vacancies. In the
lead-bromide and -chloride compounds, halide vacancies become relatively more
prominent, and for MAPbBr$_3$, the Pb$^{2+}$ interstitial also becomes
important. The trends can be explained in terms of the changes in electrostatic
interactions and chemical bonding upon replacing cations and anions. Defect
physics in MASnI$_3$ is strongly dominated by tin $({2-})$ vacancies, promoted
by the easy oxidation of the tin perovskite. Intrinsically, all compounds are
mildly p-doped, except for MASnI$_3$, which is strongly p-doped. All acceptor
levels created by defects in the six perovskites are shallow. Some defects,
halide vacancies and Pb or Sn interstitials in particular, create deep donor
traps. Although these traps might hamper the electronic behavior of MAPbBr$_3$
and MAPbCl$_3$, in iodine-based perovskites their equilibrium concentrations
are too small to affect the materials' properties.
