If it stores too much electricity, its behavior turns aggressive. To avoid this, it occasionally discharges excess energy and calms itself down.
Its long tail serves as a ground to protect itself from its own high voltage power.