Raspberry Pi basically runs on Linux which takes time to start once powered. If you have designed some hardware solution which controls valuable things, you probably don’t want it to fail on power failures. Like for desktop computers there UPS used, same technique can be applied to Raspbbery Pi. The only difference is scale of things. Juice4halt shares Raspberry backup power solution. He uses couple supercapacitors for energy storage.
Since supercaps are low voltage like 2.7V there is step-up/down circuit needed to take care of charging and draining power. He made whole power board that sits on top of Raspberry Pi. It carries two independent Ds/Ds converters where on is used for charging supercaprs in step-down mode and powering board from them through step-up converter. Another DC/Dc converter is used as front end step-down converter which converts input voltage in to 5.1V. This is convenient for using any wall DC adapter. With two 25F 2.7V supercaps and 375mA constant current draw on Raspberry Pi it is capable to supply for about 61second. So it can withstand short power failures. If you need longer times, probably adding more supercaps should help or think of normal UPS.