In an old folktale, the Sorcerer's Apprentice, the young apprentice uses a magic spell to command a broom to fetch buckets of water to his shop. Trouble is he forgets the spell to stop the brooms and the shop is soon flooded. He needs a pair of spells. Activators and repressors provide this magic for DNA.
The details are an area of ongoing investigation. Each gene has a promoter region where activators and repressors can attach. Prokaryotes so far appear to rely on a single activator-repressor pair for each gene. Eukaryotes may require cascades of activators and repressors. This allows a more sophisticated response to multiple conditions in the environment. Eukaryotes also make use of enhancers, distant regions of DNA that can loop back to the promoter.