Capacitor Vrms vs Vpeak Rating in Transformerless Supply
RMS voltages (and RMS currents) are just an abstraction humans use to boil down a bunch of numbers so we don't have to deal with an infinite number of instantaneous voltages from moment-to-moment. Similar to averages. It is an idea but not a "real" physical voltage. For example, the average birth rate might be 1.2 babies per person. How can you physically give birth to 1.2 living babies in reality? You can't.

Similarly, the capacitor is not a human. It doesn't work with abstractions. All it knows is what it physically experiences in physical reality which is the instantaneous voltage from moment to moment, and the highest instantaneous voltage the capacitor ever sees is the peak voltage so it must be able to withstand it.

A similar example is if you spend just as much money as you earn to survive. You have just as much money going into your bank account as you do coming out of your bank account. So on average, you are surviving with zero dollars in your bank account. But does that mean you can survive with no money? No, it doesn't. Because it is not the average that matters in this case. It is the moment-to-moment amount of money you have that matters. The average is just an abstracted number produced from many numbers so you can't use it as a replacement for the actual numbers in instances when the actual number at the moment matters.