Instead of three cars, let's make the problem more intuitive by using one car going from A to B at 2 mph, then B to A at 3 mph, then A to B at 4 mph. We wish to find the average speed.
WLOG, suppose the distance from A to B is 1 mile. Then
, which is the harmonic mean of 2, 3, and 4.