We study the components of cool and warm/hot gas in the circumgalactic medium (CGM) of simulated galaxies and address the relative production of OVI by photoionization versus collisional ionization, as a function of halo mass, redshift, and distance from the galaxy halo center. This is done utilizing two different suites of zoom-in hydro-cosmological simulations, VELA (6 halos; $z>1$) and NIHAO (18 halos; to $z=0$), which provide a broad theoretical basis because they use different codes and physical recipes for star formation and feedback. In all halos studied in this work, we find that collisional ionization by thermal electrons dominates at high redshift, while photoionization of cool or warm gas by the metagalactic radiation takes over near $zsim2$. In halos of $sim 10^{12}M_{odot}$ and above, collisions become important again at $z<0.5$, while photoionization remains significant down to $z=0$ for less massive halos. In halos with $M_{textrm v}>3times10^{11}~M_{odot}$, at $zsim 0$ most of the photoionized OVI is in a warm, not cool, gas phase ($Tlesssim 3times 10^5$~K). We also find that collisions are dominant in the central regions of halos, while photoionization is more significant at the outskirts, around $R_{textrm v}$, even in massive halos. This too may be explained by the presence of warm gas or, in lower mass halos, by cool gas inflows.