I can go into depth, but I'll try to stay concise and focus on your controllers.
The 5370 series CompactLogix use a capacitor to store energy for two purposes: to maintain the controller real-time-clock during powerdown, and to run the controller during the power-down sequence.
When you shut off the supply power to a 5370 series CompactLogix, the controller goes through a shut-down sequence that includes writing the current values of the Tag Database to internal nonvolatile memory. This takes longer than just "dump the RAM and re-load the default values later", so it uses a relatively large amount of energy from the capacitor for a few seconds.
After the program and tag database are safely saved to internal nonvolatile memory, the controller settles down and uses just a trickle of current to run the clock backup.
The endurance of the clock backup varies with temperature a little, but in general it's about a month. Knowledgebase document ID 468536 has some details (Access Level: Everyone).
Because the program and tag database values have been saved to flash, they will remain stored indefinitely.
Storing a program on the SD card is different; the controller can load from SD card on powerup depending on how it's been configured (the configuration is stored on the SD card and read at powerup if the card is present).
But the controller always saves its tag database values at powerdown to the onboard nonvolatile memory, not to the SD card.