The relative importance of electron-lattice (e-l) and electron-electron (e-e) interactions in ordering orbitals in LaMnO3 is systematically examined within the local-density approximation + Hubbard U approximation of density functional theory. A realistic effective Hamiltonian is derived from novel Wannier state analysis of the electronic structure. Surprisingly, e-l interaction (approximately or = 0.9 eV) alone is found insufficient to stabilize the orbital ordered state. On the other hand, e-e interaction (approximately or = 1.7 eV) not only induces orbital ordering, but also greatly facilitates the Jahn-Teller distortion via enhanced localization. Further experimental means to quantify the competition between these two mechanisms are proposed.