The origin of the cooperative Jahn-Teller distortion and orbital order in LaMnO3 is central to the physics of the manganites. The question is complicated by the simultaneous presence of tetragonal and GdFeO3-type distortions and the strong Hund's rule coupling between e{g} and t{2g} electrons. To clarify the situation we calculate the transition temperature for the Kugel-Khomskii superexchange mechanism by using the local density approximation+dynamical mean-field method, and disentangle the effects of superexchange from those of lattice distortions. We find that superexchange alone would yield T{KK} approximately 650 K. The tetragonal and GdFeO3-type distortions, however, reduce T{KK} to approximately 550 K. Thus electron-phonon coupling is essential to explain the persistence of local Jahn-Teller distortions to greater than or approximately 1150 K and to reproduce the occupied orbital deduced from neutron scattering.