Optical pumping will at most only achieve equal population of a two-level system. This is because the probabilities for raising an electron to the upper level and inducing the decay of an electron to the lower level (simulated emission) are exactly the same! In other words, when both levels are equally populated, the numbers of electrons "going up" and "down" will be the same, so you cannot achieve population inversion which is required for lasers. The solution is to use a third metastable level. The pumping will be between the other two, but electrons in the upper energy level will quickly decay into the metastable level, leaving the upper level practically unpopulated at all times. The transition from the metastable level to the ground level has a different frequency: the laser frequency. The pumping frequency is between upper level and the ground level, so the pumping is off-resonant to the laser transition and will, thus, not trigger stimulated emission.
In fact, the first laser that was demonstrated to operate was a three-level laser, Maiman's ruby laser.
In the above diagram of a three level laser the pump causes an excitation from the ground state to the second excited state. This state is a rather short-lived state, so that the atom quickly decays into the first excited level. [Decays back to the ground state also occur, but these atoms can be pumped back to the second excited state again.] The first excited state is a long-lived (i.e. metastable) state which allows the atom to "wait" for the "passer-by" photon while building up a large population of atoms in this state. The lasing transition, in this laser, is due to the decay of the atom from this first excited metastable state to the ground state. If the number of atoms in the ground state exceeds the number of atoms that are pumped into the excited state, then there is a high likelihood that the "lasing photon" will be absorbed and we will not get sustained laser light. The fact that the lower lasing transition is the ground state makes it rather difficult to achieve efficient population inversion. In a ruby laser this task is accomplished by providing the ruby crystal with a very strong pulsating light source, called a flash lamp. The flash lamp produces a very strong pulse of light that is designed to excite the atoms from their ground state into any short-lived upper level.t In this way the ground state is depopulated and population inversion is achieved until a pulse of laser light is emitted. In the ruby laser the flash lamp light lasts for about 1/1000 of a second (1 ms) and can be repeated about every second. The duration of the laser pulse is shorter than this, typically 0.1 ms. In some pulsed lasers the pulse duration can be tailored using special methods to be much shorter than this, down to about 10 fs (where 1 fs = 10-15 s or one thousandth of a millionth of a millionth of a second). So, the output of a three-level laser is not continuous, but consists of pulses of laser light.