Pouring boiling water into a glass container is a quick way to shatter it, but the tempered glass used in teapots is different. It's specially strengthened to withstand the stresses caused by sudden temperature changes, either by chemical or physical means. Although this tempered glass is unusually durable, it's still prudent to exercise some care when using it.
Why Glass Shatters
Glass is a brittle material. It's relatively strong for its weight, but it breaks easily when subjected to stress. Heat stress causes much the same effect because, like many other materials, glass expands and contracts as it heats and cools. If cool glass suddenly has hot liquid poured in, or if hot glass is set down on a cold surface, the expanding hot side and contracting cold side can apply enough force to make the glass break.
And Why Sometimes it Doesn't
Most kitchens contain a wide range of heat-resistant glass products, from cups and teapots to casserole dishes, so clearly it's possible to work around that limitation. One way is to make glass that's innately resistant to thermal shock. This is done by adding boron oxide to the glass when it's manufactured. The boron produces an extra-tough glass called borosilicate, which can withstand about three times as much heat stress as ordinary glass. It's used in laboratory glassware and industrial applications, as well as in bakeware and cookware for the home.
Keeping Your Temper
A second approach to heat resistance manipulates the physical characteristics of glass through a process called tempering. It's done by subjecting orrdinary glass, or soda-lime glass as it's sometimes called, to a sudden cold blast of air while it's still hot from the furnace. This creates thermal stress, which is preserved as the glass hardens. This essentially counters any thermal stress the glass is exposed to during normal use, making it resistant to shattering. It has the additional benefit of strengthening the glass against damage from physical stress, which is also useful in the home kitchen.
Using Your Glass Teapot
Whether your teapot is made of borosilicate or the cheaper heat-tempered form of glass, it's important to remember that it is heat-resistant rather than heatproof. If the ambient temperature in your kitchen is low, swish warm water around the teapot to gently warm it before you use it. That's a good technique anyway, because your tea will steep more effectively if the water doesn't lose heat to the teapot. Once you've poured in the boiling water, rest your teapot on a trivet or kitchen towel rather than on the cold countertop. These simple precautions can help your teapot survive through many years of safe use.