Hierarchy of stand-on / give-way: power-driven vessels give way to sailing, sailing to fishing, fishing to NUC and RAM.
In practice
Master assesses the encounter against the hierarchy; bridge team lookout reports vessels' lights/shapes. Hierarchy applies but Rules 5/6/7/8 are unconditional.
Regulatory detail & full definition
COLREG Rule 18 — Responsibilities Between Vessels: ranks the priority of give-way responsibility. Power-driven vessels keep out of the way of vessels not under command, vessels restricted in ability to manoeuvre, vessels engaged in fishing, and sailing vessels. Sailing vessels keep out of the way of NUC, RAM, and fishing vessels. Vessels engaged in fishing keep out of the way of NUC and RAM. Seaplanes and WIG craft sit at the bottom of the hierarchy. The hierarchy is a rule of seamanship — Rules 5, 6, 7, and 8 still apply to all ships.