A shuttle valve contains a small internal ball or spool that shifts back and forth between two inlet ports. When pressure is applied to either inlet, the internal element moves to block the opposite inlet and opens a path from the pressurized inlet to the output port. If both inlets are pressurized, the valve selects the higher-pressure source.