Valves with three ports serve many different functions. A few of the possibilities are listed here.
Three-way ball valves come with a T- or L- shaped fluid passageways inside the rotor. The T valve might be used to permit connection of one inlet to either or both outlets or connection of the two outlets. The L valve could be used to permit disconnection of both or connection of either but not both of two inlets to one outlet.
Shuttle valves automatically connect the higher pressure inlet to the outlet while (in some configurations) preventing flow from one inlet to the other.
Single handle mixer valves produce a variable mixture of hot and cold water at a variable flow rate under control of a single handle.
Thermostatic mixing valves mix hot and cold water to produce a constant temperature in the presence of variable pressures and temperatures on the two input ports.