What is the purpose of the valve between these two pipes?
It is a bypass valve meant to be opened when the other two valves are closed.

The horizontal pipe above is connected using two diverter tees:



In a one-pipe system, each diverter tee restricts flow to direct a portion of the hot water through the local radiator and then return that flow back to the main line.  If the radiator in this room were shut off using only the vertical ball valves without opening the horizontal bypass valve, then the water flow would be restricted for the entire system, hurting heat delivery to the rest of the house.