Capacitors are energy storage devices.  They can be used for that purpose, for triggering other devices, or other applications.  They are really very simple to understand: there are two plates made of conductors very near each other...  if you fill one plate with negatives, then the other plate is filled with positives.... in this situation, the capacitor is storing lots of energy, which it can release.

In my zapper, the capacitors are used to protect other components.  Alternating current switches its direction very often, and there are always power surges when you use alternating current (AC).

The capacitors in this circuit serve to "level out" the AC and therefore protect other components.