Play along with this 12V DC power supply connected to EU mains voltage.
Orange is the stepped down AC voltage
Green is the DC voltage across the FB rectifier
Blue is the DC load voltage.
The left switch allows to understand the role of the capacitor while the right one is used to enable the linear regulator.
Sim is unstable when starting with the regulator enabled.