Origin: A possibly fictitious form of seafaring execution. Rather than killing someone directly, by hanging, shooting, or stabbing, they were dumped in the drink.
Execution and the lead up to it has long been considered a form of entertainment, including victims pleading for their lives and their inevitable death. So, rather than simply pushing the victim over the side, the crew would extend a plank off the side of the ship. The victim would then have to walk off it of their own volition, generally after some proding with sharp pointy objects.
Popular fiction often portrays the victims hands as bound to make sure they drown, but that would hardly be necessary except to make them easier to control before the execution: Up until very recently, most European sailors couldn't swim! Even for those who could swim, any significant distance from shore meant swimming would only allow them to survive long enough to be shark food instead of simply drowning.
Modern Usage: Refers to forced resignation from a job, usually under threat of some kind.
"So, you quit your job?"
"Yeah, after those pictures surfaced, they made me walk the plank."