Pilot operated directional valve shifts the spool by external control pilot pressure, and changed the flow direction of hydraulic system. Used pilot operated ports XY, shifts the spool to switch between A and B.