An electromagnetic solenoid allows the valve slide to move & switch operation modes. This solenoid is usually connected to the thermostats controlled by two wires: a blue (common) wire that goes to one side and an orange wire to the other. With that wire configuration, systems can use the orange wire to activate the reversing valve in cooling mode.
However, it is worth noting that manufacturers Ruud and Reem do not use an orange wire to activate their systems' reversing valves in cooling mode. Instead, they use the B-terminal or blue wire to activate the solenoid in heating mode.