The system relies on a combination of two engineered P elements. P elements are a naturally occuring transposable element in the Drosophila genome: a complete 2.9kb element encodes a transposase enzyme that catalyses the element's excision and reintergration at novel sites. P elements were the first germline tranformation system developed for Drosophila. An engineered P element contains a marker gene that confers an easily recognised phenotype on flies bearing the element. Nowadays. the most common marker gene is white, which is required for the eyes of the fly to take up the red and brown pigments that give Drosophila its brick red eyes (white is so-named because mutants have white eyes due to an inability to take up pigments).
The first element of the Gal4-UAS system carries to transgene to be expressed, downstream of several copies of the yeast Gal4 Upstream Activating Sequence (UAS). Essentially, the UAS is a sequence to which the yeast Gal4 transcription factor binds, thereby driving transcription of the downstream sequences (in this case, the transgene of interest). In the absence of Gal4, the transgene contained within this element is transcriptionally inactive. We can refer to this element as the responder element.
Since Gal4 is a yeast transcription factor, how can we cause the transgene to be expressed? This is achieved by using a second element, which expresses the gene encoding Gal4 in specific cells and at specific times. This element can be referred to as the driver element.
In practice, we can drive expression of our transgene, by crossing a strain of flies carrying a driver element with our strain carrying the responder element. In the progeny flies which carry both elements, the transgene will be expressed in whatever cells are expressing Gal4. For example ey-Gal4 uses the eyeless gene promoter to express Ga4 in the developing eye.
It follows therefore that a single transgene can be expressed in any number of spatiotemporal pattern for which a driver element can be obtained - and there is a huge array of different drivers available. To this can be added an extension to the system - by using a Gal4-progesterone receptor fusion (called GeneSwitch), we can add a further level of control- the GeneSwitch version of Gal4 is only transcriptionally active when it binds the progsterone analogue RU486 (usually administered in the fly's diet).