I'll muse here a little about the shapes of the alveoli which are basic functional units of respiratory exchange in the lungs. Two caveats: (1) This isn't a mathematical answer, (2) I don't really know that much about the stuff below.
The alveoli appear to be roughly globular sacs surrounding cavities - to a very very rough approximation you might say spherical and hence constant mean curvature.
Minimal and constant mean curvature surfaces show up in nature often when one is considering the shape of an interface between two fluid phases, e.g. air and water (as in soap films) -- this is because they minimize area given some fixed pressure difference between the two phases. As such they are often a "go-to" for interesting mathematical surfaces.
However, lung tissue is made out of cells connected by an intricate network of proteins; see e.g. this wikipedia article. Thus their response to forces from air pressure is more like that of elastic sheets rather than fluid membranes; in particular there is an energy cost to bending as well as stretching and the interplay between these can lead to very diverse behavior. Such elastic sheets are described (in a certain idealized limit) by the Föppl–von Kármán equations rather than the minimal surface or constant mean curvature equations. No doubt there is also a spherical solution to these equations if one sets the forces and boundary conditions properly (corresponding to say a very slightly stretched balloon).
Though you could get a spherical shape both ways, the difference in mechanism is important if you want to understand how the shape changes as the pressure difference changes, or if there is a mutation affecting the density of the collagen network, etc.
Complicating matters is the fact that the cells are not static building blocks but grow and die over time. While this is unlikely to be important over the timescale of a single breath, I think an interesting and so-far unaddressed question (at least as far as my searches went) is how the mechanical forces from pressure during breathing affect the growth and development of the alveoli.
In particular it seems significant that the alveolar sacs do not seem to develop in detail until after birth (see here) suggesting that their development may be in response to mechanical stimuli.
There has even been some amount of attention in the media about studies showing that alveoli can regrow even in adults with speculation about future lung regeneration therapy, e.g. here and here. I think even the article that is the source for the second image in your question discusses the growth and development of alveoli in older rats (the older wisdom being that this process is halted after infancy).
While I couldn't find anything about alveoli in particular, there is a growing (pun intended) body of work on the interplay between mechanics and form in biological systems. Here's one recent very nice paper by Savin et al: "On the growth and form of the gut".