In LaAlO3/SrTiO3 heterostructures, a commonly observed but poorly understood phenomenon is that of electron trapping in back-gating experiments. In this work, by combining magnetotransport measurements and self-consistent Schroedinger-Poisson calculations, we obtain an empirical relation between the amount of trapped electrons and the gate voltage. We find that the trapped electrons follow an exponentially decaying spatial distribution away from the interface. However, contrary to earlier observations, we find that the Fermi level remains well within the quantum well. The enhanced trapping of electrons induced by the gate voltage can therefore not be explained by a thermal escape mechanism. Further gate sweeping experiments strengthen our conclusion that the thermal escape mechanism is not valid. We propose a new mechanism which involves the electromigration and clustering of oxygen vacancies in SrTiO3. Our work indicates that electron trapping is a universal phenomenon in SrTiO3-based two-dimensional electron systems.