The mechanism of aggregation-induced emission (AIE), which overcomes the common aggregation-caused quenching (ACQ) problem in organic optoelectronics, is revealed by monitoring the real time structural evolution and dynamics of electronic excited state with frequency and polarization resolved ultrafast ultraviolet/infrared spectroscopy and theoretical calculations. The formation of Woodward-Hoffmann cyclic intermediates upon ultraviolet excitation is observed within picoseconds in dilute solutions of AIE moleculetetraphenylethylene(TPE) and its derivatives but not in their respective solid. The ultrafast excited state cyclization by crossing a conical intersection (CI) provides an efficient nonradiative relaxation pathway in solutions. Without such a reaction mechanism, the electronic excitation is preserved in the molecular solids and the molecule fluoresces efficiently, aided by the very slow intermolecular charge and energy transfers due to the well separated nonplanar molecular packing arrangement in solids. The mechanisms revealed can be general for tuning the properties of chromophores in different phases for various important applications.