Question d’entretien chez Texas Instruments

How does a transistor work as a switch?