Battery Charging Backup Circuit
If V3 is on, power goes through the resistor and back into the battery (the resister value is arbitrary, I just haven't figured out what it should be).

Correct. With the values shown the V2 battery will be charged with a current given by \$ I = \frac {V_3 - V_2} R_1 = \frac {5 - 4.5} {100} = 5 \ \text {mA} \$.
Now that I've run the simulation I can see that for a 100 Ω load BAT2 will never charge. Due to the voltage drop of D1 V(B) is lower than that of BAT2.

The power doesn't go through the D2 diode because it's reverse biased.

Correct. Actually from the simulation we can see that D2 is always forward biased (for R2 = 100 Ω).

But why doesn't the power go from the battery, V2, through the resistor and to the load as well?

It would if the diodes didn't need several hundred millivolts to &quot;crack open&quot;. Since the top of R1 and D2 are connected there should be no voltage between the two so there is no voltage across D2 and it won't conduct. I've explained this in an article What is an LED? which you might find helpful.

And when V3 is out and the battery is powering the load, which path does it take? Does it go through the D2 diode or the resister?




simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. Circuit for simulation.

Figure 2. Results of simulation. Battery V3 has been replaced by a 5 V square-wave source to show what happens with V1 connected and disconnected.
Note from the simulation:

V(A) alternates between 5 V and 0 V. When high the current through D1 is 40 mA.
The simulator has added a 2 Ω internal equivalent series resistor (ESR) so we can see a little variation on V(B) depending on whether it's being charged or discharged.
Notice that I(R1) [blue] is always positive (for the point I'm measuring at). This means that BAT2 is always discharging even when V1 is high.
When V1 is switched off V(B) drops to about 3.8 V and so D2 conducts and the resistor current increases to about 8 mA.

If you hit the &quot;Simulate this circuit&quot; link you should be able to play with the battery voltages and load resistance to get a better idea of what's going on.