Some of the proteins in an egg white attract water and some repel them. When the whites are vigorously whipped, air is forced in and the entanglement of proteins separates. The water-loving proteins cling onto the water, while the water-repelling proteins cling onto the air, creating bubbles.