The bubbles appear when the cheese is being made. There are (good!) bacteria in the milk which produce gas, which in turn makes the holes in the cheese.
The cheese-makers know exactly what they have to do to make the holes and the authorities say exactly how big the holes have to be!