Spinning is a very old art, and has been around in one form or another for thousands of years. There are a number of different spinning techniques that have been employed throughout the ages, but they all involve the act of twisting lengths of fibres in such a way that the fibres cling to each other.
To make a thread, the fibres cannot be simply all in one big clump, but instead are drawn out into a long, thin strip so that fibres at one end are twisted to into the next clump which are in turn twisted into the next clump, thus creating a chain of fibres twisted into each other - which forms the body of the thread.
Some fibres are better than others at "gripping" one another (for example, wool is excellent for this purpose, having natural, tiny "hooks" on its surface which grip onto one another quite well). This grippiness determines the strength of the resulting thread, obviously the more a fibre grips to itself, the less likely it is for the thread to come apart when pulled upon.
Some fibres are naturally longer than others (for example silk is a very long fibre - as a single fibre forms the entirety of a silk-worm's cocoon). The length of a fibre is called the fibre's staple - this means that the chain does not have to be as clumped-up for it to still be gripping onto fibres 'above' it in the chain, and therefore determines how fine a thread can be spun.