From carbon dioxide.
Different types of cheese are produced using various bacteria.
For example, when creating Swiss Emmental, bacteria Streptococcus thermophilus and Lactobacillus helveticus are used, which produce lactic acid. This acid is then fermented by bacteria of the genus Propionibacterium.
As a result, substances are formed that give Emmental its 'nutty' flavor, and carbon dioxide is a byproduct. It is the bubbles of carbon dioxide that create the voids in the cheese, which appear as holes in the slice.