It makes it cook more evenly and also I think medieval bakes used to transport bread on wooden racks so bread with holes were more of a thing back then cuz you could easily stick them on the pegs. Pretzels and donuts also have holes in them. But I'm not a historian so maybe I'm talking out my ass
Edit: Some guy on has a more comprehensive explanation.
It makes it cook more evenly and also I think medieval bakes used to transport bread on wooden racks so bread with holes were more of a thing back then cuz you could easily stick them on the pegs. Pretzels and donuts also have holes in them. But I'm not a historian so maybe I'm talking out my ass![shrug-outta-hecks shrug-outta-hecks](https://www.hexbear.net/pictrs/image/7cc4b291-507e-4aa2-9ba6-35d81eb4a08a.png)
Edit: Some guy on
has a more comprehensive explanation.