Basalt is a volcanic rock (coming from volcanic activity) formed from the rapid cooling of low-viscosity lava, rich in magnesium and iron.
The volcanic activity can happen on the surface, or can be submarine. When the lava flow happens over the air, formations called “Columnar basalt” are very common. Instead, when the eruption happens underwater, very common is the formation of “Pillow Basalt”.