The 12 to 18 m high columnar basalt of the Devils Postpile ranks as one of the world’s finest examples of columnar basalt. About 100,000 years ago, a volcano erupted north of Pumice Flat and filled the valley of the Middle Fork of the San Joaquin River with runny basaltic lava.
As the lava flow ceased, the molten rock began cooling into solid rock. Shallow parts of the lava flow would have solidified first, with deeper parts of the lava lake requiring much more time to release the massive amount of stored thermal energy. As the lava lake cooled and solidified from a molten soup to solid rock it began to contract. Contraction stresses developed because the cool solid form of basalt has a lesser volume than the hot liquid form.
Cracks, also called joints by geologists, began to form. Jointing releases internal stress created by the cooling and associated contraction. In some locations, such as at the Devils Postpile, the jointing formed columns. Jointing would have begun at the top, bottom and all around the edges of the lava lake where the lava made direct contact with a cooler surface. The cracks would have extended inwards over time as the more insulated locations within the lava lake finally released enough thermal energy to change from a liquid to a solid state.
The Devils Postpile used to be much taller than what we see today. Powerful erosive forces have been at work during the last 80,000 to 100,000 years carving, shaping and demolishing remnants of the lava flow.
Freeze-thaw cycles help break apart the columns. Earthquakes knock columns down into the talus slope below. The river slowly eats away at pieces that fall into the water. The last major glacial period ended about 15,000 years ago. Glacial polish and striations evident on top of the Postpile are from this last glaciation.
According to Wikipedia/ nps