Where Did It Come From?
I had rather assumed that the "sheets" in question were the sails, but as it turns out, I was wrong. They are actually the ropes that hold the sails. It is a shortened form of an old English word sceatline or "sheet-line" which has the root word sceata, which means the lower part or corner of a sail.
The earliest written mention we have of this expression is in the journal of Rev. Francis Asbury. Asbury was a British Methodist who, in 1771, went to America and spent the next 45 years traveling about the frontier preaching. He kept a journal which was later published- along with his letters- in a three volume set. One entry from 1813 describes an incident in Kentucky:
The earliest use of the idiom in a novel that is known of is found in Scottish writer Catherine George Ward's 1824 book The Fisher's Daughter: "Wolf replenished his glass at the request of Mr. Blust, who, instead of being one sheet in the wind, was likely to get to three before his departure."
So this is the origin of the idiom "three sheets to the wind"; it's nautical in origin, but not quite the way I originally thought.