: : Well now, consider it being used in conjuction with trap doors on a gallows or knocking the chair out from under a hanging victim, to be more precise, or perhaps the practice of inducing a mild form of strangulation during sex that has been known to be fatal.

I thought it had something to do with milking a cow -- a cow kicking the bucket. Or the cow kicking the milker who in turn kicks the bucket. But it says here...
KICK THE BUCKET - "A suicide who stands on a pail, slips at noose around his neck and kicks the pail, or bucket out from under him would be the logical choice for the origin of this old slang term meaning to die. However, some etymologists say the phrase comes from an entirely different source. Slaughtered hogs, their throats slit, used to be hung by their heels, which were tied to a wooden block and the rope then thrown over a pulley that hoisted the animals up. Because hoisting the block was similar to raising a bucket from a well, the wooden block came to be called a 'bucket,' and the dying struggles of the hogs kicking against this 'bucket' supposedly gave birth to the phrase. There are other theories, however, and this old expression - it may date back to the 16th century - must be marked of unknown origin." From "Encyclopedia of Word and Phrase Origins" by Robert Hendrickson (Facts on File, New York, 1997).