Good question! Geologists are not all in agreement, but possibilities include weathering, gas pockets trapped in the magma from which the rock was formed, or (most likely)a combination of both.
Wanda Olszewski, Superintendent, Hueco Tanks State Park and Historic Site