The OED defines it as “A ship’s latrine (in the bows),” so they apparently take it as a straightforward extension of definition 21 “The fore part of a ship, boat, etc.; the bows.” The first two citations are:
1748 SMOLLETT Rod. Rand. I. xxviii. 253 The madman.. took an opportunity, while the centinel attended him at the head, to leap over-board. 1905 Trans. Inst. Naval Archit. XLVII. I. 29 The W.C.s for officers, and the seamen’s head for the crew, are to be fitted where shown on the drawings.
Quite a gap between them!