To make cheese you need the help of bacteria. Different types of bacteria in different combinations give rise to the distinct variety of flavours in many cheeses. There are various different types of bacteria used for making Swiss cheese, the one responsible for the holes is called Propionibacterium shermanii. Once this bacteria is heated slightly it reacts forming bubbles of carbon dioxide, which become the final holes in the product.
The technical term for these holes is ‘eyes’. The size of these ‘eyes’ can be controlled by the cheesemakers by altering the acidity, temperature and curing time of the mixture. Generally, in most foods which require fermentation, bubbles of carbon dioxide will be formed but most of the time they escape. The procedure which goes into making Swiss cheese means those bubbles remain trapped inside which means there will be ‘eyes’ in the final product.
Plus, take a look at: