Mechanical stretch fabric
I can think of two different ways to make textiles stretchy.
You can create mechanical stretch by using a knitting process, rather than a weaving process, to create the textile. Stretch is inherent in knitted fabrics because of the way the threads or yarns are linked. (Think about a sweater, a t-shirt, or a pair of yoga pants.) Many woven materials will have a tiny bit of stretch along the bias (think of it as the hypotenuse of the warp and woof / weft of the woven threads).
The other way to create stretch is to include some percentage of a yarn that has inherent stretch. Spandex and elastane are the generic words for these kinds of yarns. Lycra, by DuPont, is the most famous brand name. Spandex can be used in either knitted or woven fabric.
In a knitted fabric (like a t-shirt, sweater, bathing suit, etc.) spandex creates the great benefit of enabling the garment to return to its original shape after being stretched repeatedly. This is especially important in swimwear , hosiery, leotards, and other apparel items designed to fit very snugly, but it's extremely useful in just about any knitted garment. In a woven fabric, even 1%-3% spandex can allow a pair of jeans, a blazer, or a shirt to be cut more closely to the body while still remaining comfortable to wear, because the spandex enables it to "give" a little when the wearer moves or stretches, and reduces wrinkling. In recent years even the elite woolen suiting mills of Italy have discovered the benefits of adding a bit of Lycra to their woven woolens.