It’s one of the oldest party tricks: Blowing the bottom off a glass bottle simply by hitting it on the top. When struck from the top, the bottle easily moves downwards while the liquid does not because it has higher inertia. This results in the formation of a near-vacuum environment at the bottom of the bottle (the bubbles). Because this area is now empty, the liquid moves downwards with the full pressure of our atmosphere (101 kPa) through a process called inertial cavitation. The resulting shockwave easily causes the glass to shatter.
Source: https://youtu.be/lj3x2U4CaEs (The Slow Mo Guys)