Alternators are AC generators with internal rectifiers that convert the AC to DC. However there is still a ripple effect on the DC, call it voltage spikes that are normally absorbed by the battery, which smooths out the DC to a fairly steady voltage. The voltage regulator cannot react fast enough to do this. The voltage spikes would be high enough to cause damage to some avionics without the smoothing effect of the battery. Normally the master switch is constructed in such a way that the battery cannot be shut off without also shutting off the alternator to prevent this from happening. This is not a problem in aircraft that use DC generators or starter/generators.