Surprisingly, how bubbles form is poorly understood. It’s not an area that has received a lot of study. In fact, until recently, there wasn’t an established understanding of the physics of blowing bubbles.
The phenomenon, the researchers found, can be explained as a contest between the pressure the gas jet exerts on the film and the surface tension of the film, which resists any increase in curvature. Bubbles form when the jet’s pressure is large enough to deform the film into a hemispheric dimple of the same width as the jet. At that point, the film has reached its maximum curvature, and the bubble can fill with gas and float away.
More information is available at Physical Review Letters, although it is unfortunately hidden behind a paywall.