It's fairly simple. The voltage is produced by the Alternator. If the car is running and you see a battery light come on this is caused because the draw is GREATER than what is being produced by the alternator. Simple math, if the output is 320 volts and the alternator is supplying 300 volts then the remaining draw is supported from the battery.
When the alternator fails, you will draw power directly from the battery until is has depleted it's charge. With a normal battery is will inevitably take its toll and the battery will never hold a full charge. This is why dry cell batteries are better, even if after a full draw cycle it will still re charge to full power.
SO when you replaced the battery this is why the warning light was off and the car ran ok for a short time AND since the alternator was not producing enough output it again failed.
Good for future diagnostic tools!