There are several factors that make bread be "holey". First of all we must understand that those big holes are created by "balloons" of gluten filled with CO2 and alcohol made by yeasts. Those balloons can grow in 2 ways
- Yeast cells close to the balloon make CO2 or alcohol, and it's "poured" into the balloon, and it grows.
- The wall between 2 balloons gets broken, so a new balloon is made with the joining of the former two.
You would also get some bubbles with rye bread and bacteria, but the holes would be smaller. So I'll focus on wheat flour and yeasts.
So, some tips to maximize the size of the holes:
Please, note that those points are not independent. Thanks @rumtscho for pointing it out.
Don't manipulate the dough too much.
Most breads have 2 fermentations:
bulk one and
proofing. Do just one. The more you handle the dough, the higher chances to degas it by breaking bubbles and letting the gas get out of the dough.
With more water the dough will be less stiff, so bubbles will be able to extend more. Also, it will be easier for the yeasts to "find" their food: sugar, so they'll produce more CO2 and alcohol.
Some flours absorb more water than others. Using a flour with high absorption index might allow you
Yeast + time
The more yeasts, the more gas will be made. But be aware not to add too much, or they'll run out of glucose. It's better to give them time to do their work.
Use strong wheat flour
The more time dough is waiting to be risen, the more gluten will be destroyed by enzymes. So using flour with a lot of gluten (strong, high % proteins, a W value over 270) will help assuring a minimum of gluten will still exist after long fermentations.
Yeasts continue producing CO2 until they die at 60C/140F. Also, gasses expand with heat, so it will also help holes to grow a bit (if I remember well, up to 30%). But that grown will stop when dough gets baked and strengthens, and when crust begins to form. To retard this 2 tricks are used:
Use steam in the oven the fist 1/3 or 1/4 of baking time.
Steam will keep the "outer skin" of the bread humid, so it will prevent it from getting dry and forming the crust.
Score the bread
Bread is slashed (those cuts made in its surface) to allow it to grow more easily. So inner bubbles will be able to grow more in the oven.
To allow heat enter in the dough from the bottom to up, bakers use stones in their ovens.
Develop the gluten completely
Kneading is very important, so the gluten network will perfectly developed to retain all the CO2 and alcohol.
To get high hydration doughs, bakers make a normal hydration dough (approx. 66%) with all the flour, and then add the rest of water and knead a bit more to let it absorb it.
An example of a type of bread with big holes can be seen in this Spanish forum (sorry: it's a Spanish bread and I couldn't find it in English).
Ciabattas are also a good example of big holes bread.
Some tips to minimize the holes:
As opposite to high hydration to get big alveolus. As low as 50%
Degas the dough
Some artisan or home bakers press the dough with their hand to avoid having too big bubbles. For certain types of bread, professional bakers use rolls to make a thin one. It's called refinement, and might be made several times (maybe 5 during proofing).
With less gluten, the bubbles will break letting the gas go out of the dough.
Use a short fermentation time so yeasts won't be able to make too much CO2.
Pierce the dough
So any excess of CO2 will leave through the holes, instead of getting kept inside the dough.
Also, to lower the production rate of the yeasts, you can also add a lot (really a lot) of salt, or a lot of sugar, or grease/oil.
As an example, a couple of breads (again in Spanish): Pan Candeal and Bollo Sevillano.