Now the “forecastle” is merely the forward and, usually, raised part of a ship; the part, below the deck, where the sailors live.
That still explains fore, but the castle section has become so completely obsolete that, indeed, anyone pronouncing the entire word other than “fo’ksl” labels himself immediately as a landlubber.
But in the fourteenth and later centuries that forward part of a vessel used in naval warfare served as a floating fortress or castle.
By its eminence the captain could command the decks of an enemy, and through embrasures in its parapet, shot could be directed.