Clay is a residual of rock erosion. Crystalline rocks, consisting of all sorts of silicates, especially field spars, erode never completely. The remains of the erosion are often soft clays, consisting of very small grains of silicates. Sometimes those clays are even covered by other sediments and re-transformed into rocks by diagenesis. Those rocks are called mudstones or shales.
Recent deposits of clay, or shales with little modification, are often mined for various purposes. Common clay is used for sealing landfills from the groundwater, better qualities are used for adobes, bricks, ceramics and even porcelain. The products are as various as the chemical composition of the clays. A special clay called bauxite, after the French village Le Baux, is an aluminium oxide and main source of aluminium.
The use of clay is very old, mining and subsequent treatment too. Probably the first use was pottery. Clay is easily dissolved in water, but after being heated it becomes hard, water proof and water tight. It is usefull to store food and even cook. Unfortunately it becomes also fragile.
Adobes are a very old technology to build houses. As above there is a little problem with water, so this works only in arid areas. Burning the adobes results in bricks, a common way to built houses in many countries. Main reason is the easy mining of the clay.
Almost all clay mined on earth is mined in huge open cast mines or quarries. But sometimes, the clay was even mined underground.