Walk the Plank was thought to be a lethal form of punishment practiced by pirates, mutineers and other rogue seafarers. The victim was forced to walk off the open end of the gangplank, which was normally used for connecting ship(s) to a dock.
The idea being they would fall into the water to drown, sometimes with bound hands or weighed down, perhaps in the vicinity of sharks.
Though the concept does not have any historical references to pirates per se, many believe it was just a myth created by cinema. But, the phrase "walking the plank" is recorded in English writer Francis Grose's "Dictionary of the Vulgar Tongue", which was published in 1788 (first published in 1785).