The lac operon is a group of genes in E. coli that regulates lactose metabolism, consisting of a regulatory gene, promoter, operator, and structural genes. It functions based on the presence or absence of glucose and lactose, with lactose acting as an inducer to activate gene expression. Regulation occurs through various mechanisms including catabolite repression and the presence of gratuitous inducers.