My understanding of transformers is that they take in and give out AC signals.
However, the UPS system below has its DC batteries connected to a transformer. Is
it possible to know the rational behind this design?
Probably the batteries are connected to the windings through some electronic switch mechanism (power MOSFETs, for example). They are switched with alternating frequency to the primary windings, so that the primary sees an alternate frequency.
From the photo you can see beefy wires to some heatsinks with power devices (MOSFETs?) attached. This could be a clue in that direction.
Some UPS topologies include a DC/AC converter (inverter) that may look like this:
Note that the center tap of the primary is connected to a positive battery terminal.
This picture should explain better the principle: