When you put a piece of wire (here the Al foil) inside a capacitor, you get two series capacitors. When voltage is applied, the 4 plates of the two series capacitors will charge with +/-/+/-.
This means at one end of the Al foil we have -, the other end +. Some of the charges will stick to the plastic balls after the foil is removed, each ball will get opposing polarity charges, which will turn them into a polarized dipole. Once the charges stick, when an electric field applies, the polarized dipole will orient itself into the E field.
Could have been used any other way to deposit some electric charges, e.g. the triboelectric effect, and the plastic dipole will orient itself just the same.
https://youtu.be/2GQTfpDE9DQStatic electricity can be very fun: