How does a relay or switch work with batteries or capacitors?
A comparator with hysteresis can enable a switch device (power MOSFET, relay, etc.) when the cap voltage exceeds one trip point, then disable the switch device when the cap voltage falls below a second (lower) trip point.  The switch will remain off until the cap voltage exceeds the first (higher) trip point, and the cycle repeats.
The comparator device can be a comparator IC or an opamp.  It is important that all signals stay within the comparator's input and output voltage ranges.  This forum and others have threads covering comparators with hysteresis.