They are just particles that interact with each other. There are a bunch of rules the particles follow as they move about.
1. Gravity: every particle is accelerated towards every other particle. The center of gravity of all the particles falls near the center of the screen so they all tend to rotate about the center, each in their own orbit.
2. Collision and heat: When 2 particles collide they change direction and produce heat. The faster the particles are moving when they collide the more heat they produce. The hotter a particle gets the brighter it glows. When a particle gets too hot it will create a new particle. (only up to the maximum number of particles)
3. The new effect I was going for was lightning. When two particles are in range there's a chance that an electrical arc will jump from one particle to the next. This also causes the particles to heat up.
I'm going to remake this in 3d, and try to improve it. I'm going to give each particle a charge which causes magnetism so particles will attract and repel against each other in addition to the force of gravity. The electrical arcs will jump from negatively charge particles to positive ones. I'm hoping this will make the lightning effect look better as the lightning bolts will tend to travel in the same general direction.