It is not simply the water-air surface tension that allows the insect to walk on water. It is the combination of the legs not being wetted and the surface tension. The legs of water striders are hydrophobic.Water molecules are strongly attracted to one another. This is due to "hydrogen bonding": a proton in water is shared between two oxygen atoms of two water molecules. Considering only water and air, minimizing the interface surface area is the lowest energy state, because it allows for maximum interaction between water molecules. If the water molecules were attracted to the molecules of the insect legs and wetted them, the legs would sink into the liquid. However, in the context of the legs not being wetted, the attractive forces of the water molecules result in a net upward force on the legs of the insect as the legs deform the surface.