The warning light is like a pair of balance scales between the ignition circuit and the charging circuit, and that is how it is connected - from the white of the ignition circuit, through the bulb, and to the dynamo/alternator via the brown/yellow. (Note that the lamp-holder is unique in that it has two wires - one to each side of the bulb - and the body of the holder should not be connected to earth like the panel lamps are.)
If both circuits have the same voltage then there is no potential difference across the bulb and it will not light. This is irrespective of whether there is 0v on both circuits (ignition off, engine stationary) or 12v (actually around 14v when charging) on both circuits (ignition switched on and engine running and charging). If the two circuits show a potential difference i.e. ignition switched on but engine stationary or ignition switched on and engine running but not charging, then the lamp will light. This latter condition is a fault (and incidentally the main purpose of the light) which should be investigated before you get stranded. You may also note that when you switch off the ignition but while the engine is still spinning the ignition warning light glows again until the engine stops.
On a dynamo system the warning light is connected to the dynamo output at the control box and hence has a low-resistance path to earth to light it when the ignition is turned on. The initial excitation for the dynamo field always comes from its own residual magnetism, which is why you have to 'flash' the field terminal to battery when you install a new dynamo or when you are converting from one polarity to another.
This residual magnetism results in a dynamo output of a couple of volts, which is passed through low-resistance windings on the cut-out and current regulator relays in the control box to the field winding. This voltage now causes the dynamo to output its full voltage, which operates the cut-out relay to connect the dynamo output to the battery so charging it. The cut-out relay has a normally open contact which disconnect the dynamo when the engine is stopped, or the output voltage drops below a certain level, in fact it usually releases at idle, lighting or flickering the warning lamp. If this did not happen the battery would rapidly discharge through the dynamo, which would be acting like a motor trying to turn the engine. The cut-out relay has two windings, one of which ensures the relay releases as the voltage falls.
IMPORTANT NOTE: If you manually operate the cut-out relay with the engine stopped it will latch in, connecting battery voltage to the dynamo, which will try to turn the engine. This passes a high current through the control box and dynamo which will burn them out in quite a short time
Light glows dimly at night only relevant to alternators. If the warning light glows dimly at night, and increasingly brightly as the load is increased, then faulty alternator diodes are indicated. Open circuit diodes will cause a reduction in output, either voltage or maximum current, so the battery charging may not be immediately affected. Short-circuit diodes are more serious, usually resulting in a reduced charging voltage, and can cause noticeably increased levels of heat and/or noise in the alternator. It may be possible to replace the diode pack inside the alternator, alternatively replace the alternator.