As said it goes to the warning light, it is part of the charging circuit and the alt won't charge without it (Unless revved around 4K). When stationary it's the terminal to which it connects is an earth and thus the bulb illuminates, when running and charging correctly the terminal gives out power and so two lives are no good hence extinguishing the bulb telling the driver all is well.
The wire runs goes to the connector which plugs into the instruments.
Martin