The lac operon is a regulatory system in E. coli that controls the metabolism of lactose based on the presence of glucose and lactose. It involves three key genes: beta-galactosidase, lactose permease, and thiogalactosidase transacetylase, which are expressed or repressed depending on environmental conditions. The system uses both negative regulation by a repressor protein and positive regulation by the CAP-cAMP complex to modulate transcription based on sugar availability.