The strong mutual attraction of water molecules to each other is known as surface tension. Normally, surface tension makes it impossible to stretch the water out to make a thin film. Soap reduces surface tension and allows a film to form. Because of surface tension, a soap film always pulls in as tightly as it can, just like a stretched balloon.
A soap film makes the smallest possible surface area for the volume it contains. If a bubble is floating in the air and makes no contact with other objects, it will form a sphere, because a sphere is the shape that has the smallest surface area compared to its volume. (Wind or vibration may distort the sphere.)
The patterns of different colors in a soap bubble are caused by interference. Light waves reflected from the inner and outer surfaces of the soap film interfere with each other constructively or destructively, depending on the thickness of the bubble and the wavelength (that is, the color) of the light. For example, if the soap film is thick enough to cause waves of red light to interfere destructively with each other, the red light is eliminated, leaving only blue and green to reach your eyes.