How does this circuit, from an LED night light, work?
This is just a capacitor power supply .The reactance of C1 sets up the AC current for the bridge rectifier diodes.As Andrew Morton had commented this is much more efficient than a resistor .You could use an inductor here but the cap is smaller and cheaper .R2 limits surge currents at startup .C2  in conjunction with R3       filters the 100Hz current pulses from the bridge rectifier to stop led flickering .The resistance of R2 and R3 is chosen to be low compared to the reactance of C1 .The resistance of R1 is chosen to be high compared to the reactance of C1 .This means that efficiency can be good .If R1 were not present C1 could hold charge giving somebody a shock if they touched the bare mains plug prongs after power up and pulling the plug from the wall .I put R1 across C1 .If your cap exceeds 100nF then you must bleed it .The voltage rating of R1 must be understood .2 resistors in series is often seen as a way to address this .C1 must be a mains rated saftey cap .R2 must be rated for the surge currents that can occur at start up .