Years ago, when I was in high school, the electronics club took a tour of the local central office, and this is where I learned a lot of this stuff. If some has been modernized, forgive me.
The phone equipment actually runs on a large bank of batteries, which are recharged when the voltage hits 48, and stops charging at 52v. They have a standby benerator for power outages.
I also remember the ring voltage as 90, but at 25Hz, and a square wave, but I'll concede to Z's memory, as it was 30+ years ago. Interestingly, pulse-dialing phones still function on modern systems.