The two components are connected in series so that the varying resistance in the sender will affect the position of the needle on the gauge.
If the wrong-sized wire is used, or if a wire becomes broken or disconnected, this can cause an accidental short circuit which bypasses the resistance of the component. The current in the wire may become dangerously high and melt the wire or cause a fire.
Modern cars often need room for many wires in confined spaces. Some manufacturers now use printed circuits instead of bundles of wires, particularly at the rear of the instrument panel.
The side and tail lights, however, which you may need to leave on when the car is parked, are always wired independently of the ignition switch. When fitting extra accessories, such as a rear window heater which consumes a heavy current, always wire it through the ignition switch.