The flute emits sound waves across a range of frequencies. When these waves strike a window pane, the glass—having its own natural resonant frequencies—begins to vibrate sympathetically at matching frequencies.
If the flute’s volume is sufficient and the frequency aligns closely with a modal resonance of the glass (determined by size, thickness, and mounting), the vibration becomes visible—even audible as a buzz. In extreme cases (very high volume, perfect match), the stress can exceed the glass’s tensile strength and cause shattering.
Mirrors, picture frames, and lightweight furniture can exhibit the same phenomenon. It’s a classic demonstration of forced resonance.