The bottle is acting as a Helmholtz resonator. This is the same phenomenon that acts when you blow across the top of the bottle. The volume of the air inside the bottle and the mass of air in the neck of the bottle work together to determine the pitch of the resulting sound. As the bottle fills, the volume of air decreases, and the pitch increases.
To understand Helmholtz resonance, lets first about resonance in general. An example of resonance is seen when you attach a mass to a spring and shake that spring with you hand In the case of a mass attached to a spring, its easy to visualize. You can shake the spring at whatever frequency you want, but there is a particular frequency where you don't need to shake your hand very much to get a large amplitude response. That's resonance.
In Helmholtz resonance, the "mass" is the amount of air inside the neck of your bottle. The "spring" is the volume of air inside your bottle - as you fill the bottle with water, you're changing the volume of air inside the bottle. There is an inverse relationship between the resonant frequency and the volume inside the bottle. SO as the volume decreases the pitch goes up.
And so you hear a tone rising in pitch as the bottle fills.
See attached for the rest.© BrainMass Inc. brainmass.com October 10, 2019, 6:14 am ad1c9bdddf
The resonance in longitudinal waves and wave problems are examined.