Spinning is a very old art - around in one form or another for thousands of years. There have been a number of different spinning techniques 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, obviously the fibres aren't all in one big clump, but 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 "holding onto" one another (for example, wool is excellent for this prupose, 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 one another - this 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.