As the lava cooled rapidly, contraction occurred. While contraction in the vertical direction reduced the flow thickness (without fracturing), horizontal contraction could only be accommodated by cracking throughout the flow. The extensive fracture network produced the distinctive columns seen today. While most are six-sided, some are anywhere from 5- to 8-sided.
The basalts were originally part of a great volcanic plateau called the Thulean Plateau which formed during the Paleogene period.
Thanks to Wikipedia.
So why did it contract in a vertical direction instead of a horizontal contraction?