Yarn

Yarn is a long continuous length of interlocked fibres, suitable for use in the production of textiles, sewing, crocheting, knitting, weaving, embroidery, or ropemaking. Thread is a type of yarn intended for sewing by hand or machine. Modern manufactured sewing threads may be finished with wax or other lubricants to withstand the stresses involved in sewing. Embroidery threads are yarns specifically designed for needlework.
Etymology.
The word yarn comes from Middle English, from the Old English "gearn", akin to Old High German's "garn", "yarn", Italian's "chordē", "string", and Sanskrit's "hira", "band".
Materials.
Yarn can be made from a number of natural or synthetic fibers. Many types of yarn are made differently though. There are two main types of yarn: spun and filament.
Fibers.
The most common plant fiber is cotton, which is typically spun into fine yarn for mechanical weaving or knitting into cloth.
Cotton and Polyester are the most commonly spun fibers in the world. Cotton is grown throughout the world. After harvesting it is ginned and prepared for yarn spinning. Polyester is extruded from polymers derived from natural gas and oil. Synthetic fibers are generally extruded in continuous strands of gel-state materials. These strands are drawn (stretched), annealed (hardened), and cured to obtain properties desirable for later processing.
Synthetic fibers come in three basic forms: staple, tow, and filament. Staple is cut fibers, generally sold in lengths up to 120 mm. Tow is a continuous "rope" of fibers consisting of many filaments loosely joined side-to-side. Filament is a continuous strand consisting of anything from 1 filament to many. Synthetic fiber is most often measured in a weight per linear measurement basis, along with cut length. Denier and Dtex are the most common weight to length measures. Cut-length only applies to staple fiber.
Filament extrusion is sometimes referred to as "spinning" but most people equate spinning with spun yarn production. 
The most commonly spun animal fiber is wool harvested from sheep. For hand knitting and hobby knitting, wool and acrylic yarns are frequently used.
Other animal fibers used include alpaca, angora, mohair, llama, cashmere, and silk. More rarely, yarn may be spun from camel, yak, possum, musk ox, vicuña, cat, dog, wolf, rabbit, or bison hair, and even chinchilla as well as turkey or ostrich feathers. Natural fibers such as these have the advantage of being slightly elastic and very breathable, while trapping a great deal of air, making for some of the warmest fabrics in existence.
Other natural fibers that can be used for yarn include linen and cotton. These tend to be much less elastic, and retain less warmth than the animal-hair yarns, though they can be stronger in some cases. The finished product will also look rather different from the woolen yarns. Other plant fibers which can be spun include bamboo, hemp, maize, nettle, and soy fiber.
T-shirt yarn is a yarn made directly from t-shirts, and the fiber composition is determined by the material the t-shirt is made from.
Comparison of material properties.
In general, natural fibers tend to require more careful handling than synthetics because they can shrink, felt, stain, shed, fade, stretch, wrinkle, or be eaten by moths more readily, unless special treatments such as mercerization or superwashing are performed to strengthen, fix color, or otherwise enhance the fiber's own properties.
Some types of protein yarns (i.e., hair, silk, feathers) may feel irritating to some people, causing sensations of contact dermatitis, hives, wheezing reactions. These reactions are likely a sensitivity to thicker and coarser fiber diameter or fiber ends. In fact, contrary to popular belief, wool allergies are practically unknown. According to a study reviewing the evidence of wool as an allergen conducted by 
Acta Dermato-Venereologica contemporary superfine or ultrafine Merino wool with their reduced fibre diameters do not provoke itch, are well tolerated and in fact benefit eczema management.
Further studies suggest that known allergens applied during textile processing are minimally present in wool garments today given current industry practices and are unlikely to lead to allergic reactions.
When natural hair-type fibers are burned, they tend to singe and have a smell of burnt hair; this is because many, as human hair, are protein-derived. Cotton and viscose (rayon) yarns burn as a wick. Synthetic yarns generally tend to melt though some synthetics are inherently flame-retardant. Noting how an unidentified fiber strand burns and smells can assist in determining if it is natural or synthetic, and what the fiber content is.
Both synthetic and natural yarns can pill. Pilling is a function of fiber content, spinning method, twist, contiguous staple length, and fabric construction. Single ply yarns or using fibers like merino wool are known to pill more due to the fact that in the former, the single ply is not tight enough to securely retain all the fibers under abrasion, and the merino wool's short staple length allows the ends of the fibers to pop out of the twist more easily.
Yarns combining synthetic and natural fibers inherit the properties of each parent, according to the proportional composition. Synthetics are added to lower cost, increase durability, add unusual color or visual effects, provide machine washability and stain resistance, reduce heat retention or lighten garment weight.
Structure.
Spun yarn.
Spun yarn is made by twisting staple fibres together to make a cohesive thread, or "single." Twisting fibres into yarn in the process called spinning can be dated back to the Upper Paleolithic, and yarn spinning was one of the first processes to be industrialized. Spun yarns may contain a single type of fibre, or be a blend of various types. Combining synthetic fibres (which can have high strength, lustre, and fire retardant qualities) with natural fibres (which have good water absorbency and skin comforting qualities) is very common. The most widely used blends are cotton-polyester and wool-acrylic fibre blends. Blends of different natural fibres are common too, especially with more expensive fibres such as alpaca, angora and cashmere.
Yarn is selected for different textiles based on the characteristics of the yarn fibres, such as warmth (wool), light weight (cotton or rayon), durability (nylon is added to sock yarn, for example), or softness (cashmere, alpaca).
Yarn is composed of twisted strands of fiber, which are known as plies when grouped together. These strands of yarn are twisted together (plied) in the opposite direction to make a thicker yarn. Depending on the direction of this final twist, the yarn will have either "s‑twist" (the threads appear to go "up" to the left) or "z‑twist" (to the right). For a single ply yarn, the direction of the final twist is the same as its original twist. The twist direction of yarn can affect the final properties of the fabric, and combined use of the two twist directions can nullify skewing in knitted fabric.
The mechanical integrity of yarn is derived from frictional contacts between its composing fibers. The science behind this was first studied by Galileo.
Hosiery Yarn.
Hosiery yarns are used in the manufacturing of Knitted fabrics. Since the knitted materials are more delicate than woven materials; hence hosiery yarns are made 'softer' with fewer twists per inch than their woven counterparts.
Open-end yarn.
It is produced with rotors in open-end spinning without using a spindle. The method of spinning is different than ring spinning. In open-end yarn, there is no roving frame stage. Sliver from the card goes into the rotor, is spun into yarn directly. Open-end yarn is possible to produce with shorter fibers. The characteristics of open-end yarn are different than the ring yarns. The open-end yarns are limited to coarser counts.
Novelty yarn.
Novelty yarns or complex yarns are the yarns with special (fancy) effects introduced during spinning or plying. One example is Slub yarns; the slub effect means a yarn with thick and thin sections alternating regularly or irregularly. In a similar manner creating deliberate unevenness, Additions or injections of neps or metallic or synthetic fibers(along with natural fibers) in spinning creates beautiful yarns.
Filament yarn.
Filament yarn consists of filament fibres (very long continuous fibres) either twisted together or only grouped together. Thicker monofilaments are typically used for industrial purposes rather than fabric production or decoration. Silk is a natural filament, and synthetic filament yarns are used to produce silk-like effects.
Texturized yarn.
Texturized yarns are made by a process of air texturizing filament yarns (sometimes referred to as "taslanizing"), which combines multiple filament yarns into a yarn with some of the characteristics of spun yarns.
Colour.
Yarn may be used undyed, or may be coloured with natural or artificial dyes. Most yarns have a single uniform hue, but there is also a wide selection of variegated yarns:
Yarn quantities for handcrafts are usually measured and sold by weight in ounces or grams. Common sizes include 25 g, 50 g, and 100 g skeins. Some companies also primarily measure in ounces with common sizes being three-ounce, four-ounce, six-ounce, and eight-ounce skeins. Textile measurements are taken at a standard temperature and humidity, because fibers can absorb moisture from the air. The actual length of the yarn contained in a ball or skein can vary due to the inherent heaviness of the fibre and the thickness of the strand; for instance, a 50 g skein of lace weight mohair may contain several hundred metres, while a 50 g skein of bulky wool may contain only 60 metres.
There are several thicknesses of craft yarn, also referred to as weight. This is not to be confused with the measurement and/or weight listed above. The Craft Yarn Council of America is making an effort to promote a standardized industry system for measuring this, numbering the weights from 1 (finest) to 6 (heaviest). Some of the names for the various weights of yarn from finest to thickest are called lace, fingering, sport, double-knit (or DK), worsted, aran (or heavy worsted), bulky, and super-bulky. This naming convention is more descriptive than precise; fibre artists disagree about where on the continuum each lies, and the precise relationships between the sizes.
Another measurement of yarn weight, often used by weavers, is wraps per inch (WPI). The yarn is wrapped snugly around a ruler and the number of wraps that fit in an inch are counted.
Labels on yarn for handicrafts often include information on gauge, known in the UK as tension, which is a measurement of how many stitches and rows are produced per inch or per cm on a specified size of knitting needle or crochet hook. The proposed standardization uses a four-by-four inch/ten-by-ten cm knitted or crocheted square, with the resultant number of stitches across and rows high made by the suggested tools on the label to determine the gauge.
In Europe, textile engineers often use the unit tex, which is the weight in grams of a kilometre of yarn, or decitex, which is a finer measurement corresponding to the weight in grams of 10 km of yarn. Many other units have been used over time by different industries.
Microscopic aspect of selected yarns.
Below are the images taken by a digital USB microscope. These show how the yarn looks in different kinds of clothes when magnified.