Dear student
Imagine that all holes of the flute are closed.
The tube of flute is serves full length for the sound to vibrate inside.
As soon as a hole is opened, The length of the air column is reduced and hence the frequency of sound changes
We know the relation between the length of pipe, wavelength and frequency of sound in a closed and open ended pipe
assuming n, v constant
L varies due to opening and closing of holes
hence f varies