All liquids have a property called surface tension. Take water, for example. Water molecules are strongly attracted to each other.
Therefore the molecules on the surface of the water are not attracted towards the air, but rather towards the rest of the water. This attraction is what creates surface tension, forming a sort of skin on the water’s surface.
Surface tension is also what accounts for soap bubbles. Dipping a wand into regular water won’t work because the water’s surface tension is so strong that the molecules would rather bunch together in a puddle than be stretched across the opening of the wand.
The addition of soap helps because these molecules have two distinct ends, one that is attracted to water, and one that is not.
When a wand is dipped into soapy water, soap molecules cover the surface of the film, with their water-loving ends facing the water. Since the water molecules are now attracted not only to each other but also to one end of the soap molecules, the water is held in place as it stretches across the wand, forming a soapy film.
Blowing into the film is similar to blowing into a balloon: the rush of air makes the film stretch and expand. Surface tension makes the soap water molecules still attached to the wand automatically come together, closing the developing bubble’s open end.
Once this happens, sealing the air inside its skin, the completed bubble releases and floats away.