Pouring boiling water into a glass is highly likely to shatter it because the hot water contacts only a few part of the glass first whereas the other parts of the glass (such as the outside of the cup) remain cooler. The glass thus does not expand as a whole, but is pulled in different directions as part of it expands and part does not. This difference produces the shattering.