Consider the illustration from the previous page. Although more modern views of the atom do not depict discrete orbits for the electrons, it can be useful to think of these orbits as the different energy levels of the atom. In other words, if we apply some heat to an atom, we might expect that some of the electrons in the lower-energy orbitals would transition to higher-energy orbitals farther away from the nucleus.
This is a highly simplified view of things, but it actually reflects the core idea of how atoms work in terms of lasers.
Once an electron moves to a higher-energy orbit, it eventually wants to return to the ground state. When it does, it releases its energy as a photon -- a particle of light. You see atoms releasing energy as photons all the time. For example, when the heating element in a toaster turns bright red, the red color is caused by atoms, excited by heat, releasing red photons. When you see a picture on a TV screen, what you are seeing is phosphor atoms, excited by high-speed electrons, emitting different colors of light. Anything that produces light -- fluorescent lights, gas lanterns, incandescent bulbs -- does it through the action of electrons changing orbits and releasing photons.