The gene that codifies the beta-galactosidase enzyme is part of the <em>lac</em> operon, which also contains two other genes that produce enzymes involved in the metabolization of lactose.
Between glucose and lactose, the bacteria will preferentially use glucose as an energy source. On the other hand, lactose is a dimer, and thus a series of enzymes are needed to process lactose before its use as an energy source.
If there is no lactose present, the genes contained inside this operon are turned off (the operon is repressed).
In an absence of lactose, Lac repressor binds to <em>lac</em> operator. And as a result of this binding, transcription of <em>lac</em> operon will be prevented. Hence all the above mentioned genes of the <em>lac </em>operon will be repressed or will be turned off.
The ultimate source of energy (for most ecosystems) is the sun<span>. The ultimate fate of energy in ecosystems is for it to be lost as heat. Energy and nutrients are passed from organism to organism through the food chain as one organism eats another.</span>