  The relative importance of electron-lattice (e-l) and electron-electron (e-e)
interactions in ordering orbitals in LaMnO$_3$ is systematically examined
within the LDA+$U$ approximation of density functional theory. A realistic
effective Hamiltonian is derived from novel Wannier functions analysis of the
electronic structure. Surprisingly, e-l interaction ($\simeq 0.9$ eV) alone is
found insufficient to stabilize the orbital ordered state. On the other hand,
e-e interaction ($\simeq 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.
