Bench testing rally gauges
Since the gauges function by heating wire inside the gauge, switching the power off and on relatively fast doesn’t cause the gauge to move with the voltage switching. The gauge responds to the average power, which would be about the equivalent of applying 6 volts all the time, assuming the power was off and on for equal times.
This is the same principle as incandescent dimmers in your house. To dim your lights, the dimmer turns the power off and on very fast. So fast that the filament does not have time to cool down and flicker. The light bulb integrates (averages) the voltage. The longer the dimmer is on (compared to the time it is off), the brighter the bulb gets. The technical name for this is Pulse Width Modulation (PWM)
The capacitor is there as a noise filter, so you don’t hear it switching on your am radio.