Bridge rectifier: What is the purpose of these two elements?
That is a de facto circuit for cheap generic mains powered LED lamps.
The capacitor is an essential part, the circuit is called a &quot;capacitive dropper&quot; which is used to bring down the voltage at modest current level to power the LEDs.
The 220k resistor is necessary to keep the LEDs turned off, so that they do not glow faintly due to capacitive coupling in the mains wiring powering up the LEDs ever so slightly.