The term originates from the military title used on navy vessels but came in use for all sorts of ships.