As discussed in the quantum mechanics tutorial, there are discrete energy levels available to molecules (atoms that are bonded to each other). This is also true for the electrons that are bound to the molecule as well. In the left figure two energy levels available to the electron are shown as two separate orbital paths X and A. For each electronic energy state there will be a number of vibrational and rotational states that are available to the molecule as well. It is more convenient to think in terms of energy level, so the figure at the right shows the manifold of possible states for each electronic state. Three of these states (E1, E2 and E3) are shown in the diagram at the right.
Now consider an electron in the red (X) orbital shown in the figure. By absorbing a photon of the right frequency (hνabs=E3-E1) it can be promoted from state 1 in the X orbital to state 3 in the blue (A) orbital. Because the energy level of state 3 is so high - it is out of equilibrium - the molecule will want to relax to a lower energy state, e.g. state 2. During this relaxation a photon is emitted to remove the excess energy, and this process is called fluorescence. The frequency of the emitted photon is hνfl=E3-E2.
Each molecule has its own unique set of allowable energy levels, and thus absorbs and fluoresces at specific frequencies. By choosing a laser that matches the absorption frequencies, or wavelengths, we can generate fluorescence from only a single desired species. Typically, we choose schemes that allow a sufficient difference in the absorption and fluorescence wavelength to allow separation between the laser light and the fluorescence with simple color filters to allow imaging.