Shank (sewing)

A shank is a device for providing a small amount of space in between a garment and a button. Shanks are necessary to provide space for fabric to sit in between the button and the garment when the garment is buttoned. Shanks also allow a garment to hang and drape nicely.
Types of shanks.
There are two types of shanks:
Button shank.
Shank buttons have a hollow protrusion on the back through which thread is sewn to attach the button. Button shanks may be a separate piece added to the back of a button, or be carved or moulded directly onto the back of the button, in which case the button is referred to by collectors as having a 'self-shank'. This is a common construction for older shell and glass buttons, for example. 
Buttons with shanks have no holes in the button blank (the main part of the button) itself because they are not needed for sewing. Buttons with shanks are more expensive to produce than shankless buttons.
Thread shank.
A "thread shank" is made of thread and is intended to be used with a shankless button (a button with typically two or four holes). It is created while a button is stitched onto a garment. 
Creating a thread shank.
A "thread shank" is created by loosely stitching a shankless button onto fabric. This is usually done by keeping a toothpick or other small object in between the button and fabric while the button is stitched on. Once the button has been sewn through a few times, the toothpick is removed and the needle is moved down through one of the buttonholes, placing the needle and its thread in between the button and fabric. The sewer takes care to not tighten the thread too much. While holding the button away from the garment, the thread is then firmly wrapped around the button (in between the button and fabric) a few times to form a sturdy wrapper for the other threads. The needle is then pushed through the fabric to the underside of the garment, where it can then be securely fastened off. A thread shank's length depends on the thickness of the fabric that will be buttoned. The ideal thread shank is long enough to button the fabric and still have the garment draping nicely, but short enough that the button does not flop around when buttoned.