While I don't pretend to know the whole story, I know just enough acoustics to be dangerous.
Each cavity seems to be sized to "trap" a specific audio wavelength. The size of the hole and depth tunes the chamber like an organ pipe. Some tuned for takeoff (high fan rpm, high audio frequency), and some for approach noise (low rpm, low audio frequency).
Semi-educated guess on my part.