There is general consensus that when fire ants and other ant species get shocked, they release pheromones that attract other worker ants to the site. Those workers also get shocked, release pheromones and attract still more ants to the site. As a result, switching mechanisms can get stuck "open" due to an accumulation of dead ant bodies that prevent the switch from closing and electricity to flow.
How and why worker ants are initially attracted to electrical switches and similar situations where they get shocked is poorly understood. It could result from random foraging activity, or there may be something about electrical fields that is of interest to them. Dr. Brad Vinson, Professor of Entomology at Texas A&M University, was involved with earlier lab studies that seemed to indicate that the ants have "an affinity" for electrical fields that makes them rest in those areas, thus making it more likely that they get shocked.
These videos show fire ant workers accumulating in electrical equipment: