We present the valence electron energy-loss spectrum and the dielectric function of monoclinic hafnia (m-HfO$_2$) obtained from time-dependent density-functional theory (TDDFT) predictions and compared to energy-filtered spectroscopic imaging measurements in a high-resolution transmission-electron microscope. Fermis Golden Rule density-functional theory (DFT) calculations can capture the qualitative features of the energy-loss spectrum, but we find that TDDFT, which accounts for local-field effects, provides nearly quantitative agreement with experiment. Using the DFT density of states and TDDFT dielectric functions, we characterize the excitations that result in the m-HfO$_2$ energy loss spectrum. The sole plasmon occurs between 13-16 eV, although the peaks $sim$28 and above 40 eV are also due to collective excitations. We furthermore elaborate on the first-principles techniques used, their accuracy, and remaining discrepancies among spectra. More specifically, we assess the influence of Hf semicore electrons (5$p$ and 4$f$) on the energy-loss spectrum, and find that the inclusion of transitions from the 4$f$ band damps the energy-loss intensity in the region above 13 eV. We study the impact of many-body effects in a DFT framework using the adiabatic local-density approximation (ALDA) exchange-correlation kernel, as well as from a many-body perspective using a $GW$-derived electronic structure to account for self-energy corrections. These results demonstrate some cancellation of errors between self-energy and excitonic effects, even for excitations from the Hf $4f$ shell. We also simulate the dispersion with increasing momentum transfer for plasmon and collective excitation peaks.