  Since the first report of ferroelectricity in nanoscale HfO$_2$-based thin
films in 2011, this silicon-compatible binary oxide has quickly garnered
intense interest in academia and industry, and continues to do so. Despite its
deceivingly simple chemical composition, the ferroelectric physics supported by
HfO$_2$ is remarkably complex, arguably rivaling that of perovskite
ferroelectrics. Computational investigations, especially those utilizing
first-principles density functional theory (DFT), have significantly advanced
our understanding of the nature of ferroelectricity in these thin films. In
this review, we provide an in-depth discussion of the computational efforts to
understand ferroelectric hafnia, comparing various metastable polar phases and
examining the critical factors necessary for their stabilization. The intricate
nature of HfO$_2$ is intimately related to the complex interplay among diverse
structural polymorphs, dopants and their charge-compensating oxygen vacancies,
and unconventional switching mechanisms of domains and domain walls, which can
sometimes yield conflicting theoretical predictions and
theoretical-experimental discrepancies. We also discuss opportunities enabled
by machine-learning-assisted molecular dynamics and phase-field simulations to
go beyond DFT modeling, probing the dynamical properties of ferroelectric
HfO$_2$ and tackling pressing issues such as high coercive fields.
