Before the present day lighting situation in cars, headlights were small bulbs reflected off of poor material that would erode quickly. Before that, the lights on automobiles were powered by gas or kerosene (essentially a candle on the front of your car). Now these lights are almost all LED lights and are connected to the central computing system found within all cars.
The forward, rear, side, and interior lighting on modern cars are all connected on circuits. These are powered by the battery and controlled by the user via the car’s computer. When the user toggles, or switches on, the lights, a signal is sent to the computer, which then closes the circuit creating a source of power to the lights. The different types of lights are simply different circuits that are closed when the corresponding button is pressed. For example, the turn signal is powered by a circuit that is split, whichever way the user toggles the switch, the computer closes the matching circuit, powering the left or right blinker.