Sailing ships are controlled with an intricate system of ropes, called “halyards,” “lines,” and “sheets,” whose function it is to move or hold things in place.
Sheets are the ropes that control the sails.
If one is loose, the sails will flap in the wind.
Two loose sheets will affect the ship’s steadiness.
“Three sheets to the wind” and the vessel will reel off course like a drunken sailor.
We say that someone intoxicated is “three sheets to the wind”.