To learn about the shape of bubbles, it is necessary to lean about surface tension.
Surface tension is a contractive tendency of the surface of a liquid that allows it to resist an external force. It is revealed, for example, in the floating of some objects on the surface of water, even though they are denser than water, and in the ability of some insects (e.g. water striders) to run on the water surface. This property is caused by cohesion of similar molecules, and is responsible for many of the behaviors of liquids. Cohesion or Cohesive force is the action or property of molecules sticking together, being mutually attractive. This is an intrinsic property of a substance that is caused by the shape and structure of its molecules. A molecule is an electrically neutral group of two or more atoms held together by chemical bonds. Molecules are distinguished from ions by their lack of electrical charge.
Surface tension has the dimension of force per unit length, or of energy per unit area. The two are equivalent
There is surface tension on the bubble’s skin that keeps it pulled in as tightly as it can. As air molecules trapped inside the bubble move around in all directions, its skin tends to form a sphere, being the shape with the least amount of surface area compared to the volume of air trapped inside.