In parallel. The capacitor smooths out the power and keeps it from spiking and shutting down over and over.
A resistor (in series) would help too but might restrict power too much to work well.
No harm in adding a capacitor.
On almost all my projects the weird behavior has been solved by throwing a cap in it
Deadly Premonition?