A transformer changes the amperage and / or voltage. It
literally "Transforms" electrical energy.
A ballast is like a capacitor. Think of a ballast as a
short-term battery. It stores power then releases it as needed. A
common example of a ballast is on fluorescent lights.
Initially, a fluorescent light needs a big blast of energy to
excite the gas molecules into emitting photons (light). Then it
only needs a small amount of energy to keep the gas molecules in an
excited state. However, that power has to be of consistent amperage
and voltage. The ballast is designed to do that.
The electrical ballast stores energy in the same way that a
water ballast stores water for stability. Because the electrical
ballast stores far more power than the device it regulates
requires, it too provides a kind of electrical stability. That's
why you often see a fluorescent light flicker or "lose stability"
when the ballast starts to go bad.
A transformer transforms voltage and amperage up or down.
A ballast provides a stabile power supply.