The application of gate voltages in heavy metal/ferromagnet/oxide multilayer stacks has been identified as one possible candidate to manipulate their anisotropy at will. However, this method has proven to show a wide variety of behaviors in terms of reversibility, depending on the nature of the metal/oxide interface and its degree of oxidation. In order to shed light on the microscopic mechanism governing the complex magneto-ionic behavior in $\text{Ta/CoFeB/}{\text{HfO}}_{2}$, we perform ab initio simulations on various setups comprising Fe/O and ${\text{Fe/HfO}}_{2}$ interfaces with different oxygen atom interfacial geometries. After the determination of the more stable interfacial configurations, we calculate the magnetocrystalline anisotropy energy on the different unit cell configurations and formulate a possible mechanism that well describes the recent experimental observations in $\text{Ta/CoFeB/}{\text{HfO}}_{2}$.