A lighting ballast takes power from your home's electrical system. In the United States, the ballast uses 110 volts alternating current. In other countries, it might use 220.
Unlike the filaments in incandescent lights, the gases in fluorescent lights don't conduct electricity well. To create the plasma that creates the light in a fluorescent bulb, the ballast stores a high voltage charge in a capacitor. The capacitor that provides this electricity is called an ignitor, and the ballast provides power to the ignitor.
Once the ignitor creates a plasma reaction in the gases in the fluorescent tube, the ballast supplies even power that allows the plasma reaction to continue. This allows the light bulb to provide consistent light.
The most common type of fluorescent ballast is a magnetic ballast, which regulate the power to the fluorescent tube by inhibiting current spikes. Magnetic ballasts were the first type of ballast and often have very low cycle rates that can result in subtle flickering in the light.
Modern ballasts work on the same principle as magnetic ballasts, but regulate the energy required to continue the plasma reaction using electronic components instead of magnets. This allows the ballasts to work at a higher cycle rate, thus preventing flicker.