It is an example of Resonance. Every object has a natural property called natural frequency. At a specific frequency, an object will start oscillating even without an external force constantly acting on it. When the frequency of sound matches the natural frequency of an object, in this case glass, it will make the glass vibrate intensely to the point of shattering.