Gene expression includes all kinds of life. This includes eukaryotes, prokaryotes, and viruses. Basically the gene makes a product (protein) except for in viruses because they do not have DNA but have RNA so the process is a bit different.
The protein that is made has a specific function to perform within the body, or whatever living organism we are talking about. Here is would be in bacteria. This is basically how it is controlled. The gene knows what it needs to do and what what function it needs to perform, and makes the protein necessary to make that function happen. It makes the organism more adaptable and able to change in order to survive.
Gene regulation was first discovered in E.coli
The link below has a very easy to understand way of explaining gene expression. It is hard to understand and is incredibly complex.
When transcription in bacteria is controlled,
it results from one of two events-the binding of a repressor protein to a control sequence in DNA and the prevention of transcription, or the binding of an activator protein and the promotion of transcription. (In the case of the lac operon, both events occur
Also, according to the book Biology Control, ch. 14, there are proteins involved in the process of negative control and positive regulation, which interlap and combine within their location, making the protein more malleable as far as its ability to stick or bind to others.
The regulatory proteins involved in negative control and positive regulation are often allosterically regulated, meaning that they have the ability to switch between two different conformations in response to binding by a small molecule-often a nutrient or product compound affected by the locus being regulated. The change in conformation is important because it affects the protein's ability to bind to DNA.