That is a good question.
Air bubbles maybe?
I am sure if you google it you will get several answers. Maybe then you can tell us.
It's because baceria drinks milk and p***s ut air while making cheese.
Ya, Bacteria are producing the gasses that cause the holes to form in the cheese.
Here is an article about it.
https://theconversation.com/why-does-swiss-cheese-have-holes-130451