Basalt
Basalt is a fine-grained extrusive igneous rock, the most common volcanic rock in the Earth's crust and the floor of every ocean basin. It forms when low-silica magma reaches the surface and cools quickly enough that crystals have no time to grow large.
Its low silica content makes the melt runny, which is why basaltic eruptions tend to flow rather than explode, and why basalt provinces are flat and vast rather than conical.
Why it cracks into columns
Cooling is the whole story — see Columnar Jointing. The rock contracts as it loses heat, and contraction in a sheet has to be relieved somehow.
Relation to obsidian
Obsidian is the same idea taken further: cooled so fast that it never crystallises at all and ends up as glass. Same volcanic origin, opposite texture. This protocol is named for the rock that cools into ordered columns rather than the one that cools into glass.
Related: Giant's Causeway, Columns.