This is a schematic for a crude taser design ive been studying. From what i can tell when the switch is on the relay turns on and off continuously, which charges up the LC circuit in which the capacitor and primary of the transformer (inductor) continuously charge each other up. Since the circuit turns on and off due to the oscillating relay, according to the law of voltage across an inductor, large voltages are dropped across the inductor, which when multiplied by the transformer create huge voltages on the secondary, thus the sparks. That all makes sense to me, but i have no idea what the purpose of the bidirectional TVS diode is, apparently it is to clamp the voltage at 350 volts but i have no idea what that means and the google searches i have madebwerent helpful.
Clamping the primary voltage also clamps the secondary voltage, by a factor related to the turns ratio of the transformer. This is presumably to keep the electrode voltages in a "painful, but non-lethal" range.
Also, the resonant tank circuit on the transformer primary makes sure that the AC voltage is at a very high frequency, so that the "skin effect" keeps the current from penetrating into deep tissue and affecting critical organs. This tank is excited periodically by the chattering of the relay.