In their simplest form, Gangways were narrow passages inside a Ship, that connected The Quarterdeck to The Forecastle. These passages were used for transit by Sailors (Crew). Dating to the 15th Century in construction, they were completely enclosed. With construction evolution, the need of The Gangway was extended to give passage off of a Ship (normally to Shore or Dock). Wooden reinforced walkways were created (and detachable). Affixed by rope and hook, Passengers could safety disembark from a Vessel from either it’s side or directly over The Hull.
With Ship to Ship transfer, evolved the somewhat dangerous “Gangplank”. Iconic in Pirate Lore, these were wooden planks or boards, that connected two ships for traversing at Sea or Port. Normally, when two Ships at Sea were “lashed” (or connected by rope), this was the “safest” way of going from one to another. In Port, when Outbound Ships were docked Starboard (opposite of Port), Sailors could not deploy a Gangway. The use of The Gangplank allowed them to walk from one Ship to another, to reach a Dock (Shore). Gangways are still used (as are Gangplanks) – to some degree, with most now constructed of steel or aluminum.